-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix access logging in gaiohttp worker #1193
Conversation
@@ -237,7 +237,10 @@ def log(self, lvl, msg, *args, **kwargs): | |||
def atoms(self, resp, req, environ, request_time): | |||
""" Gets atoms for log formating. | |||
""" | |||
status = resp.status.split(None, 1)[0] | |||
if type(resp.status) is int: |
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.
I would do :
status = resp.status
if isinstance(status, str):
status = status.split(None, 1)[0]
to be consistent with the style in gunicorn. Thoughts?
Good catch! Thanks. Modulo the style bikesheeding, the patch looks fine for me. If you can do the change that would help :) |
I've fixed the formatting. Found also one more issue, which should be fixed in urbaniak@4f810ee Let me know if that's appropriate for other workers. |
25eca42
to
3711228
Compare
Thought about that, done it that way because req_headers was written like that. Should be good to go now ;) |
@@ -93,9 +93,14 @@ def access(self, resp, req, environ, request_time): | |||
""" | |||
Logger.access(self, resp, req, environ, request_time) | |||
duration_in_ms = request_time.seconds * 1000 + float(request_time.microseconds) / 10 ** 3 | |||
if type(resp.status) is int: |
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.
style should also be changed there :)
@urbaniak thanks! Once last change and we are good 👍 |
7875dd9
to
5dfb627
Compare
@urbaniak would you mind squashing the commits, please? You can just force push and keep the same PR. |
5dfb627
to
353508c
Compare
No prob, squashed. Hope to get that released soon. |
Thanks! |
fix access logging in gaiohttp worker
fix access logging in gaiohttp worker
Access logs were wrongly formatted when using gaiohttp worker
It also fixes the statsd instrumentation with this type of worker.