Skip to content

johnnyoshika/elmah-io-experiment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup

  • Clone this repo
  • Open Startup.cs and update this line with proper API_KEY and LOG_ID:
app.UseElmahIo("API_KEY", new Guid("LOG_ID"));
  • Run the project

Testing elmah.io behavior 1

Notice that neither error is logged in elmah.io. This is strange as elmah.io should be able to inspect the response and notice that a 500 response is returned to the client in the second test.

Testing elmah.io behavior 2

Move registration of HandleExceptionMiddleware to before elmah.io in Startup:

app.UseMiddleware<HandleExceptionMiddleware>();
app.UseElmahIo("API_KEY", new Guid("LOG_ID"));

Notice that both errors are logged in elmah.io and both are reported as 500 errors. This makes sense as elmah.io handles the exceptions before HandleExceptionMiddleware gets a chance to change the response code.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages