Closed Edward-Zhou closed 5 years ago
Are you trying to log specific errors to the database? If not, why not just write a logging provider (or use one like serilog) that supports logging to the database?
Why do you need a way to hook the developer exception page? That's only used when developing locally (and it also logs the error to the logging system).
Yes, I am trying to log errors to database, and I also want to log the errors while development environment.
@Edward-Zhou Just use a logger provider then.
Using something like this:
@davidfowl Is there any specific reason I should not custom it in UseDeveloperExceptionPage
middleware like UseExceptionHandler
. For logger provider, I will need to implement another middleware with try catch block.
Because there's a better way to solve the problem with a system that was designed to do exactly this (log things). Both the developer exception page and the error handler log the exception.
As @davidfowl said, this middleware isn't designed for this purpose and we don't have plans to add that functionality at this time.
Is your feature request related to a problem? Please describe.
I want to log the error to database, for
UseExceptionHandler
, we could custom it inpublic static IApplicationBuilder UseExceptionHandler(this IApplicationBuilder app, Action<IApplicationBuilder> configure)
, but forUseDeveloperExceptionPage
, there is no such operation.Describe the solution you'd like
Provider the
Action<IApplicationBuilder> configure
inUseDeveloperExceptionPage