mirror of
https://github.com/bitwarden/server.git
synced 2025-05-28 23:04:50 -05:00
fixes to exception logging
This commit is contained in:
parent
cf9c8d8fe9
commit
44956b3994
@ -13,7 +13,17 @@ namespace Bit.Admin
|
|||||||
.CreateDefaultBuilder(args)
|
.CreateDefaultBuilder(args)
|
||||||
.UseStartup<Startup>()
|
.UseStartup<Startup>()
|
||||||
.ConfigureLogging((hostingContext, logging) =>
|
.ConfigureLogging((hostingContext, logging) =>
|
||||||
logging.AddSerilog(hostingContext, e => e.Level >= LogEventLevel.Error))
|
logging.AddSerilog(hostingContext, e =>
|
||||||
|
{
|
||||||
|
var context = e.Properties["SourceContext"].ToString();
|
||||||
|
if(e.Properties.ContainsKey("RequestPath") &&
|
||||||
|
!string.IsNullOrWhiteSpace(e.Properties["RequestPath"]?.ToString()) &&
|
||||||
|
(context.Contains(".Server.Kestrel") || context.Contains(".Core.IISHttpServer")))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return e.Level >= LogEventLevel.Error;
|
||||||
|
}))
|
||||||
.Build()
|
.Build()
|
||||||
.Run();
|
.Run();
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,13 @@ namespace Bit.Billing
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(e.Properties.ContainsKey("RequestPath") &&
|
||||||
|
!string.IsNullOrWhiteSpace(e.Properties["RequestPath"]?.ToString()) &&
|
||||||
|
(context.Contains(".Server.Kestrel") || context.Contains(".Core.IISHttpServer")))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return e.Level >= LogEventLevel.Warning;
|
return e.Level >= LogEventLevel.Warning;
|
||||||
}))
|
}))
|
||||||
.Build()
|
.Build()
|
||||||
|
@ -22,6 +22,13 @@ namespace Bit.Events
|
|||||||
return e.Level > LogEventLevel.Error;
|
return e.Level > LogEventLevel.Error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(e.Properties.ContainsKey("RequestPath") &&
|
||||||
|
!string.IsNullOrWhiteSpace(e.Properties["RequestPath"]?.ToString()) &&
|
||||||
|
(context.Contains(".Server.Kestrel") || context.Contains(".Core.IISHttpServer")))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return e.Level >= LogEventLevel.Error;
|
return e.Level >= LogEventLevel.Error;
|
||||||
}))
|
}))
|
||||||
.Build()
|
.Build()
|
||||||
|
@ -69,7 +69,10 @@ namespace Bit.Events
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Mvc
|
// Mvc
|
||||||
services.AddMvc();
|
services.AddMvc(config =>
|
||||||
|
{
|
||||||
|
config.Filters.Add(new LoggingExceptionHandlerFilterAttribute());
|
||||||
|
});
|
||||||
|
|
||||||
if(usingServiceBusAppCache)
|
if(usingServiceBusAppCache)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user