-
Notifications
You must be signed in to change notification settings - Fork 17
feat(logging): separate fields #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(logging): separate fields #91
Conversation
return response; | ||
} | ||
|
||
var responseContent = await response.Content.ReadAsStringAsync(); | ||
_logger.LoggerHttp_ResponseDetailed(response, response.Headers.ToFormattedString(), responseContent, stopwatchElapsed.TotalMilliseconds); | ||
_logger.LoggerHttp_ResponseDetailed(request.Method, request.Uri!, path, response.StatusCode, response.Headers.ToFormattedString(), responseContent, stopwatchElapsed.TotalMilliseconds, httpVersion); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
httpVersion theres one in the request and one in the response - for this one we can log the response one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
[LoggerMessage(LogLevel.Information, "Post-request... {response}\nHeaders: {headers}\nContent: {responseContent} in {elapsed:n0}ms")] | ||
internal static partial void LoggerHttp_ResponseDetailed(this ILogger logger, FluentHttpResponse response, string headers, string? responseContent, double elapsed); | ||
[LoggerMessage(LogLevel.Information, "HTTP request [{method}] '{requestUrl}' ({path}) responded {statusCode:D} in {elapsed:n0}ms ({httpVersion})")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Would move the version infront, and part of the request
[LoggerMessage(LogLevel.Information, "HTTP request [{method}] '{requestUrl}' ({path}) responded {statusCode:D} in {elapsed:n0}ms ({httpVersion})")] | |
[LoggerMessage(LogLevel.Information, "HTTP request ({httpVersion}) [{method}] '{requestUrl}' ({path}) responded {statusCode:D} in {elapsed:n0}ms")] |
path
I think I would remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
No description provided.