serilog-web / classic

[Discontinued] Serilog web request logging and enrichment for classic ASP.NET applications
Apache License 2.0
79 stars 32 forks source link

Added logic to check AllErrors in Context when LogEventLevel is Error #39

Closed mahichr closed 7 years ago

mahichr commented 7 years ago

There are some scenarios were application.Server.GetLastError() returns null even though Response.StatusCode is 500. In such cases extra check to get the latest error from Context.AllErrors will help Serilog to log appropriate exception in configured sink.

nblumhardt commented 7 years ago

Nice! Thanks for the PR, @mahichr 👍