josephwoodward / GlobalExceptionHandlerDotNet

Exception handling as a convention in the ASP.NET Core request pipeline
MIT License
269 stars 32 forks source link

Add ability to set loggerFactory for the ExceptionHandlerMiddleware #16

Closed lsgroi closed 6 years ago

lsgroi commented 6 years ago

Possible solution for #15

josephwoodward commented 6 years ago

Thanks for the PR!

With regards to it being a solution to #15, you're thinking you could override the _logger.UnhandledException() method?

lsgroi commented 6 years ago

Having the ability to define the ILoggerFactory allows you to be in control of the creation of _logger and as a consequence define the behaviour of _logger.UnhandledException(). In my case, I will set the factory to NullLoggerFactory because I want to avoid logging.

josephwoodward commented 6 years ago

I'm with you (I misread it as ILogger as opposed to a factory!).

Thanks once again for the PR!