Is there a way to change log format of Rails app in production?
I have Rails 3 app that runs on Nginx server using Puma. The logs goes to logs/production.log.
I was wondering if there is a way to change the format of the logs, so it includes more information that I can use. Informations like userId (if signed in) or sessionId, etc.
Is there a way to configure the format of the logs?
Right now they are like this:
Started GET "/" for xxx.xxx.xxx.xx at 2015-02-11 06:37:53 +0000 Processing by MyController#home as HTML Rendered my/home.html.erb within layouts/home (93.2ms) Completed 200 OK in 542ms (Views: 94.8ms | ActiveRecord: 158.6ms)
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×