Skip to content
This repository has been archived by the owner on May 2, 2019. It is now read-only.
/ hotline Public archive

Last resort error reporting middleware for ASP.NET Core

License

Notifications You must be signed in to change notification settings

aevitas/hotline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hotline

The only number you'll need to dial when things go south.

Hotline is a middleware component for ASP.NET Core that enabled you to report unhandled exceptions to external error tracking services.

You can obtain the package relevant to the error reporting service you're using from NuGet: Sentry

Usage

We'll configure Hotline for Sentry in this introduction. Sentry requires a DSN to make a connection; add the following to your appSettings.json:

  "Sentry": {
    "Dsn": "{your_DSN_here}"
  } 

Now we'll call Configure<SentryOptions> to wire up the configuration the middleware requires in Startup.cs:

services.Configure<SentryOptions>(Configuration.GetSection("Sentry"));

Register the SentryHotline provider with the DI container:

services.AddScoped<IHotline, SentryHotline>();

Then finally, install the middleware:

app.UseHotline();

Make sure the Hotline middleware component added to the pipeline, so definitely before app.UseMvc() and any other middleware you are running.

And that's all - any unhandled exceptions will now be automatically reported to Sentry in full.

Contributions

Any and all contributions, new providers for Hotline, bugfixes, features, are welcome. It is preferred contributions follow the netcore code style guidelines as well as the relevant C# conventions.

About

Last resort error reporting middleware for ASP.NET Core

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages