Closed jaymarvels closed 1 year ago
Apologies that it isn't clear - the Raygun Serilog Sink won't automatically listen to unhandled exception like other Raygun providers. It instead responds to the Log.Error and Log.Fatal calls.
Log.Fatal sends exceptions to Raygun synchronously and is needed when an exception is going to cause the process to crash. Log.Error sends exceptions to Raygun asynchronously so that it doesn't interrupt the process.
Within the global unhandled exception handler of your .NET6 ASP Core project, you'll want to make a Log.Error call. Best do this from all catch blocks throughout your project too.
Let us know if you have further questions.
@QuantumNightmare Ahh thanks for clarifying! Thought I was missing something!
Do you know which other providers automatically listen for unhandled exceptions?
We have quite a few different providers across several languages/frameworks. I've mostly worked in the .NET space.
The .NET Framework ones for web applications usually have an http module that you add to the configuration which will cause them to hook into various exception handlers. The .NET Core provider can attach via the middleware. Some other .NET Raygun providers have a method like "AttachCrashReporting" that will hook into the global exception handler if they are statically available. Most native mobile providers should be able to do this as well.
Not sure if that covers what you're after, so let me know if anything needs clarifying.
Will close this issue now. Do reply or start a new issue if you have further questions.
.NET6 ASP Core proj here
Implemented as per readme in my appsettings:
I purposely throw an exception
I check Raygun and nothing has been logged/comes through.