logging - Is this possible to change rails logs messages? -


standard start of rails log message this:

started "/newrelic" 192.168.18.36 @ 2013-09-04 15:19:34 +0200 

but have this:

[request_id] started "/newrelic" 192.168.18.36 @ 2013-09-04 15:19:34 +0200 

is possible achevie this?

yes, it's possible. can achieve using config.log_tags. log_tags option added in rails 3.2 , can used prepend information each log message.

in /config/environments/development.rb

myapp::application.configure   config.log_tags = [:request_id]   ... end 

Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -