mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
Added loggr logging for production environment.
This commit is contained in:
@ -6,6 +6,7 @@ using Microsoft.AspNet.Hosting;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.AspNet.Mvc.Filters;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Bit.Api.Utilities
|
||||
{
|
||||
@ -47,6 +48,9 @@ namespace Bit.Api.Utilities
|
||||
}
|
||||
else
|
||||
{
|
||||
var logger = context.HttpContext.ApplicationServices.GetRequiredService<ILogger<ExceptionHandlerFilterAttribute>>();
|
||||
logger.LogError(exception.Message, exception);
|
||||
|
||||
errorModel.Message = "An unhandled server error has occured.";
|
||||
context.HttpContext.Response.StatusCode = 500;
|
||||
}
|
||||
|
Reference in New Issue
Block a user