Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serilog .NET exception logs not detected as exceptions #95

Open
r-bennett opened this issue May 13, 2022 · 0 comments
Open

Serilog .NET exception logs not detected as exceptions #95

r-bennett opened this issue May 13, 2022 · 0 comments

Comments

@r-bennett
Copy link

I'm using Serilog 2.9.0 in a .NET application, but the output of the standard exception logging method isn't being picked up as an exception so the stack traces are being forwarded one line at a time.

e.g.

logger.LogError(e, "we caught an exception");   

produces

[09:19:23.676 ERR ApprovalBot.Controllers.EventController b497765b27218d428f9a6fd04a4951bf]  we caught an exception
System.Exception: something went wrong
   at ApprovalBot.Controllers.EventController.Baz() in E:\workspace\ApprovalBot\src\Controllers\EventController.cs:line 70
   at ApprovalBot.Controllers.EventController.Bar() in E:\workspace\ApprovalBot\src\Controllers\EventController.cs:line 65
   at ApprovalBot.Controllers.EventController.Foo() in E:\workspace\ApprovalBot\src\Controllers\EventController.cs:line 60
   at ApprovalBot.Controllers.EventController..ctor(ILogger`1 logger, IReadOnlyDictionary`2 eventHandlers, WebHookSecret secret, GitHubUri gitHubUri, IMetrics metrics) in E:\workspace\ApprovalBot\src\Controllers\EventController.cs:line 48

which isn't detected.

Having looked at the source it's not clear why they're not being detected as exceptions.

If there's nothing obviously wrong in the format above could you give me a bit of guidance on the best way to debug this locally please?
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant