style: change template for log message

This commit is contained in:
Polianin Nikita 2024-06-10 22:02:29 +03:00
parent b640902777
commit 984791f193

View File

@ -57,7 +57,7 @@ public static class LoggerConfiguration
{
app.UseSerilogRequestLogging(options =>
{
options.MessageTemplate = "Handled {RequestPath} in {Elapsed:0.0000} ms";
options.MessageTemplate = "[{RequestMethod}] {RequestPath} [Client {RemoteIPAddress}] [{StatusCode}] in {Elapsed:0.0000} ms";
options.GetLevel = (_, elapsed, ex) => elapsed >= 2500 || ex != null
? LogEventLevel.Warning