Skip to content

Tweak the default acccess log format #1

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

Merged
merged 1 commit into from
Jan 10, 2018
Merged

Tweak the default acccess log format #1

merged 1 commit into from
Jan 10, 2018

Conversation

malor
Copy link
Member

@malor malor commented Jan 10, 2018

Make sure we've got the most important information like remote addr,
request status line, response code, response size, user agent and
request processing time, e.g:

[10/Jan/2018:21:04:46 +0000] 127.0.0.1 "GET /snippets/42/raw HTTP/1.1" 200 154 "curl/7.54.0" 0.100991

Note, that for production deploys behind a reverse-proxy this format
might be changed to use the HTTP headers like X-Real-IP or
X-Forwarded-For, if needed.

@malor malor requested a review from ikalnytskyi January 10, 2018 21:06
Make sure we've got the most important information like remote addr,
request status line, response code, response size, user agent and
request processing time, e.g:

    [10/Jan/2018:21:04:46 +0000] 127.0.0.1 "GET /snippets/42/raw HTTP/1.1" 200 154 "curl/7.54.0" 0.100991

Note, that for production deploys behind a reverse-proxy this format
might be changed to use the HTTP headers like X-Real-IP or
X-Forwarded-For, if needed.
@@ -5,3 +5,5 @@

LISTEN_HOST = os.environ.get('XSNIPPET_WEB_PROXY_HOST', '0.0.0.0')
LISTEN_PORT = os.environ.get('XSNIPPET_WEB_PROXY_PORT', 5000)

ACCESS_LOG_FORMAT = os.environ.get('ACCESS_LOG_FORMAT', '%t %a "%r" %s %b "%{User-Agent}i" %Tf')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Short notice (comment) about LOG_FORMAT might be helpful.

@ikalnytskyi ikalnytskyi merged commit 3e987e6 into master Jan 10, 2018
@ikalnytskyi ikalnytskyi deleted the access_log branch January 10, 2018 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants