diff --git a/src/Ombi/ErrorHandlingMiddlewear.cs b/src/Ombi/ErrorHandlingMiddlewear.cs index ed0df0b95..01e22d0b0 100644 --- a/src/Ombi/ErrorHandlingMiddlewear.cs +++ b/src/Ombi/ErrorHandlingMiddlewear.cs @@ -31,7 +31,8 @@ namespace Ombi private static Task HandleExceptionAsync(HttpContext context, Exception exception) { - var logger = context.RequestServices.GetService(); + var loggerFact = context.RequestServices.GetService(); + var logger = loggerFact.CreateLogger(); logger.LogError(exception, "Something bad happened, ErrorMiddleware caught this"); var code = HttpStatusCode.InternalServerError; // 500 if unexpected