Open Thomas-Slippens opened 2 months ago
Hi @Thomas-Slippens - unfortunately only a very limited number of maintainers watch this repository, and it doesn't look like anyone immediately spotted the problem here. Posting this to Stack Overflow with the serilog
tag should get more eyes on it. Best of luck!
Description
I've spent the better part of 2 days on the following issue and I'm running out of ideas. Hopefully someone has had a similar experience and can help me out.
I have a .NET 8.0 iOS, Windows, and Android app with a shared backend. Serilog exception logging to application insights is working perfectly for iOS and Windows, but it only works for Android in the DEBUG configuration of my app.
Reproduction
instantiating the telemetry client during app start:
Setting up the serilogger configuration:
Writing an exception (where _platformSpecificLogger is an instance of SeriLog implementing ILogger)
_platformSpecificLogger?.LogError(exception, $"{message}, {toAppend}", toAppend);
ONLY In case the exception is unhandled we finalize with this in de Android project:
Expected behavior
On Android, after compiling my app in Release Mode, I expect exceptions logged by Serilog to be visible in Application insights.
Relevant package, tooling and runtime versions
The relevant setup: Serilog version 4.0.1 Serilog app insights version 4.0.0 Application insights version 2.22.0 Platform: .Net 8 app, Android (no Maui).
Additional Context