Rails log levels to files

201 Views Asked by At

I want to log warn messages to a file like warn.log, error messages to a file like error.log. I've googled so many pages and also the StackOverFlow, but I didn't find some parallel topics. Do you have any good suggestions?

1

There are 1 best solutions below

0
On BEST ANSWER

Use this gem multi_level_logger

Add the following in your config/environments/production.rb

config.logger =  MultiLevelLogger::MLogger.create(:all=>true)

Now your logs will be written into separate files. And your default logger will be disabled.

For more info check here