question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

With `enableDebug: true` nothing gets logged to AppInsights when message exceeds max length

See original GitHub issue

Context: We would like to use enableDebug: true for local development, but the current behavior is a blocker for this practice.

Current behavior: When the message exceeds the maximum allowed length, it will be truncated by AppInsights, but nothing will be logged when enableDebug: true, because the throwInternal called just after will throw, and also, the whole execution flow will be broken by the throw.

Expected behavior: Message truncation should be treated specially and never throw (so, it should not looking at the enableDebug flag), but only log a warning to the console (or ApplicationInsights-JS could consider changing it to console.error when enableDebug: true).

Rationale: Most of the time, it’s unreasonable to tell developers to add, to otherwise very simple business logic, a noisy concern for selecting only useful information from the error and ensuring it doesn’t exceed the maximum. Especially when the error was thrown from a 3rd party. Relying on the messages being truncated automatically for AppInsights, while logged full to the console, is often really good enough.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
markwolffcommented, Jan 18, 2019

Thanks for the feedback @slawomir-brzezinski-at-clarksons, I will definitely update the docs to clarify this!

1reaction
slawomir-brzezinski-at-clarksonscommented, Jan 14, 2019

Thank you for swift response @markwolff . If I understand correctly, the flag only exists in the beta version of the API, which actually didn’t notice yet. We will switch to it in due course.

Going back to the our goal of a setting for local development, I suppose then that the enableDebug flag will stay as is, so it seems to me that it’s not really useful to users of the library. As such, perhaps it should not be advertised as a public part of the API? In any case, it would be good if documentation made it clear what is the desired setting for outside of production, especially developer machines.

Thanks again!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exception messages are not logged when the ...
Hi all, We are observing an issue with logging of exceptions in ApplicationInsights, when the message length is > 32K limit.
Read more >
Azure Application Insights for JavaScript web apps
Maximum size of telemetry batch. If a batch exceeds this limit, it's immediately sent and a new batch is started. numeric 10000.
Read more >
microsoft/applicationinsights-web
Add Application Insights to your app. There are 2 ways to do this. Install via NPM. Then, setup an instance Application Insights in...
Read more >
Does Azure Application Insights have a max log length?
Yes, there's a max length. Please find the answer here: Azure Application Insight. Custom attribute length restriction. The message has the ...
Read more >
Logging - Julia Documentation
Example: Enable debug-level messages. Here is an example of creating a ConsoleLogger that lets through any messages with log level higher than, or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found