Skip to content
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

Changing CommonLogger format? #328

Closed
eterps opened this issue Jan 24, 2012 · 3 comments
Closed

Changing CommonLogger format? #328

eterps opened this issue Jan 24, 2012 · 3 comments
Milestone

Comments

@eterps
Copy link

eterps commented Jan 24, 2012

Is there a reason why the CommonLogger format is defined as a constant? I would like to configure the log format.

lib/rack/commonlogger.rb:
...
FORMAT = %{%s - %s [%s] "%s %s%s %s" %d %s %0.4f\n}
...

@yeban
Copy link
Contributor

yeban commented May 5, 2012

CommonLogger implements the common log format which is a standard.

@raggi
Copy link
Member

raggi commented Nov 2, 2012

I'm going to close this out. I'm happy to accept a PR that adds an option to change the format, but retains the existing format as a default.

@raggi raggi closed this as completed Nov 2, 2012
@sysout
Copy link

sysout commented Aug 12, 2016

Anyone knows how to customize the format? I want to log the http host header as well.
I am using Puma and Sinatra, but I don't know how to change the format without monkey patching.
I know in Rails we can use a lambda in Application.configure to change the config.log_tags.

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

No branches or pull requests

4 participants