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

Merged
merged 1 commit into from Feb 3, 2016

Conversation

Projects
None yet
3 participants
@urbaniak
Contributor

urbaniak commented Jan 27, 2016

Access logs were wrongly formatted when using gaiohttp worker

It also fixes the statsd instrumentation with this type of worker.

Show outdated Hide outdated gunicorn/glogging.py
@@ -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:

This comment has been minimized.

@benoitc

benoitc Jan 28, 2016

Owner

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?

@benoitc

benoitc Jan 28, 2016

Owner

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?

@benoitc

This comment has been minimized.

Show comment
Hide comment
@benoitc

benoitc Jan 28, 2016

Owner

Good catch! Thanks.

Modulo the style bikesheeding, the patch looks fine for me. If you can do the change that would help :)

Owner

benoitc commented Jan 28, 2016

Good catch! Thanks.

Modulo the style bikesheeding, the patch looks fine for me. If you can do the change that would help :)

@urbaniak

This comment has been minimized.

Show comment
Hide comment
@urbaniak

urbaniak Jan 28, 2016

Contributor

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.

Contributor

urbaniak commented Jan 28, 2016

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.

@urbaniak

This comment has been minimized.

Show comment
Hide comment
@urbaniak

urbaniak Jan 28, 2016

Contributor

Thought about that, done it that way because req_headers was written like that.

Should be good to go now ;)

Contributor

urbaniak commented Jan 28, 2016

Thought about that, done it that way because req_headers was written like that.

Should be good to go now ;)

Show outdated Hide outdated gunicorn/instrument/statsd.py
@@ -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:

This comment has been minimized.

@benoitc

benoitc Jan 28, 2016

Owner

style should also be changed there :)

@benoitc

benoitc Jan 28, 2016

Owner

style should also be changed there :)

@benoitc

This comment has been minimized.

Show comment
Hide comment
@benoitc

benoitc Jan 28, 2016

Owner

@urbaniak thanks! Once last change and we are good 👍

Owner

benoitc commented Jan 28, 2016

@urbaniak thanks! Once last change and we are good 👍

@tilgovi

This comment has been minimized.

Show comment
Hide comment
@tilgovi

tilgovi Feb 2, 2016

Collaborator

@urbaniak would you mind squashing the commits, please? You can just force push and keep the same PR.

Collaborator

tilgovi commented Feb 2, 2016

@urbaniak would you mind squashing the commits, please? You can just force push and keep the same PR.

@urbaniak

This comment has been minimized.

Show comment
Hide comment
@urbaniak

urbaniak Feb 2, 2016

Contributor

No prob, squashed.

Hope to get that released soon.

Contributor

urbaniak commented Feb 2, 2016

No prob, squashed.

Hope to get that released soon.

@tilgovi

This comment has been minimized.

Show comment
Hide comment
@tilgovi

tilgovi Feb 3, 2016

Collaborator

Thanks!

Collaborator

tilgovi commented Feb 3, 2016

Thanks!

tilgovi added a commit that referenced this pull request Feb 3, 2016

Merge pull request #1193 from urbaniak/gaiohttp-logging
fix access logging in gaiohttp worker

@tilgovi tilgovi merged commit d6a47e8 into benoitc:master Feb 3, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

fofanov pushed a commit to fofanov/gunicorn that referenced this pull request Mar 16, 2018

Merge pull request #1193 from urbaniak/gaiohttp-logging
fix access logging in gaiohttp worker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment