A
A
Alex Chistyakov2015-12-07 00:53:34
Ruby on Rails
Alex Chistyakov, 2015-12-07 00:53:34

Best logging practices in Ruby on Rails?

I have never written RoR projects before, but then suddenly I happened, and there is no time to clarify.
How is logging organized? Through Logger to a separate file? As I understand it, nothing can be added to production.log from the application? Is there such a logger setting that will automatically intercept writing to stdout and stderr, assign severity and timestamps, and then process according to the logger settings?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vsuhachev, 2015-12-07
@alexclear

In rails, logging comes out of the box - the same production.log. You can reach the logger through Rails.logger. It has the interface of a standard Ruby logger , you can override anything there, both the formatter and the device on which the log is written, and in general everything you want. The log level in the application can be set in config/environments/production.rb in the log_level property

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question