Current behavior:
The console warning message does not show the data that has been lost, by only including a message property with the post-truncation text.
Expected behavior:
Console warning should show to the user the message before truncation.
Rationale:
It's not very useful to show what the message has been truncated to, since the intent is for it to be logged - the developer will be able to see that part in the log just fine.
That truncation is the last chance to see the information that is going to be lost, so it would be good to give the developer a last chance to see it, at least in the console.
Since the internal logger also sends telemetry, it still needs to be truncated. It would be good to display the full message only to the console, while keeping the telemetry truncated. I'll look into seeing if this can be fixed, but it seems like it will take quite a bit of refactoring.
Is there also a way to disable this specific error message?
Because now the users see this warning in the console-log when they log in via Auth0:
az416426.vo.msecnd.net/scripts/a/ai.0.js:1 AI: StringValueTooLong message:"string value is too long. It has been truncated to 1024 characters." props:"{value:/callback#access_token=___VERYLONGTEXT___&scope=openid%20read:data&expires_in=7200&token_type=Bearer&state=c9fRMSzPbpPxyTQjmVkPLdKpxNp01wae&id_token=___TOKEN___}"
o.warnToConsole @ az416426.vo.msecnd.net/scripts/a/ai.0.js:1
@stefh Do you have verboseLogging enabled in your config?
I don't think so. My code is:
if (environment.instrumentationKey.length > 0) {
appInsightsService.config = {
instrumentationKey: environment.instrumentationKey
};
appInsightsService.init();
}
Most helpful comment
Since the internal logger also sends telemetry, it still needs to be truncated. It would be good to display the full message only to the console, while keeping the telemetry truncated. I'll look into seeing if this can be fixed, but it seems like it will take quite a bit of refactoring.