You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
When using Serilog to log exceptions, the message/event payload is beyond azure app-insights limits and because of that, exceptions don't get logged.
Logging the same exception with a TelemetryClient, in the other hand, logs a message which is comparatively much smaller and gets logged by azure app-insights.
Reproduction
In order to reproduce the problem, I'd have to create a docker with Elastic Search running, create an index and write a query. That would be too much of a hassle for anyone to reproduce the problem.
However, I can provide you with samples of the messages being posted by both TelemetryClient and Serilog, so that you can see that Serilog generates a much longer payload.
Here's a link with the both messages: https://www.diffchecker.com/APhYHCTO/
While the Telemetry logs the exception nicely, the Serilog logs the same exception in a completely different fashion.
The Telemetry ignores the .Request and .Response properties in the ElasticsearchClientException, while Serilog seems to be serializing them as thousands of dictionary keys in the properties list.
BTW, both .Request and .Response in the ElasticsearchClientException are read-only properties, therefore I can't set them to null as a workaround. I've tried Destructurer (IExceptionDestructurer) and Enricher (ILogEventEnricher) but that's didn't help.
Expected behavior
If Serilog wants to serialise .Request and .Response, it shouldn't be that way, right?
Relevant package, tooling and runtime versions
Serilog.Sinks.ApplicationInsights 4.0.0
The text was updated successfully, but these errors were encountered:
That's the one; however that's being referenced, it'll be configured in your logging pipeline and is responsible for the ExceptionDetail property/data on the resulting events.
Description
When using Serilog to log exceptions, the message/event payload is beyond azure app-insights limits and because of that, exceptions don't get logged.
Logging the same exception with a TelemetryClient, in the other hand, logs a message which is comparatively much smaller and gets logged by azure app-insights.
Reproduction
In order to reproduce the problem, I'd have to create a docker with Elastic Search running, create an index and write a query. That would be too much of a hassle for anyone to reproduce the problem.
However, I can provide you with samples of the messages being posted by both TelemetryClient and Serilog, so that you can see that Serilog generates a much longer payload.
Here's a link with the both messages: https://www.diffchecker.com/APhYHCTO/
While the Telemetry logs the exception nicely, the Serilog logs the same exception in a completely different fashion.
The Telemetry ignores the .Request and .Response properties in the ElasticsearchClientException, while Serilog seems to be serializing them as thousands of dictionary keys in the properties list.
BTW, both .Request and .Response in the ElasticsearchClientException are read-only properties, therefore I can't set them to null as a workaround. I've tried Destructurer (IExceptionDestructurer) and Enricher (ILogEventEnricher) but that's didn't help.
Expected behavior
If Serilog wants to serialise .Request and .Response, it shouldn't be that way, right?
Relevant package, tooling and runtime versions
Serilog.Sinks.ApplicationInsights 4.0.0
The text was updated successfully, but these errors were encountered: