Slightly change HTTP log format

This commit is contained in:
Ske 2020-08-27 14:38:11 +02:00
parent f2c18dff41
commit ca4ffdb803

View File

@ -66,11 +66,11 @@ namespace PluralKit.Bot
var routePath = NormalizeRoutePath(response.RequestMessage.RequestUri.LocalPath.Replace("/api/v7", "")); var routePath = NormalizeRoutePath(response.RequestMessage.RequestUri.LocalPath.Replace("/api/v7", ""));
var route = $"{response.RequestMessage.Method} {routePath}"; var route = $"{response.RequestMessage.Method} {routePath}";
LogContext.PushProperty("DiscordRoute", route); LogContext.PushProperty("RequestUrlRoute", route);
_logger.Information( _logger.Information(
"{RequestMethod} {RequestUrl} -> {ResponseStatusCode} {ResponseStatusString} (in {RequestDurationMs:F1} ms)", "HTTP {RequestMethod} {RequestUrl} -> {ResponseStatusCode} {ResponseStatusString} (in {RequestDurationMs:F1} ms)",
response.RequestMessage.Method.Method, response.RequestMessage.Method,
response.RequestMessage.RequestUri, response.RequestMessage.RequestUri,
(int) response.StatusCode, (int) response.StatusCode,
response.ReasonPhrase, response.ReasonPhrase,