How in Ruby on Rails(6.1) the log levels are decided?

307 views Asked by At

I want the debug logs to appear in info log level so that other unnecessary logs from debug do not appear inside production. The statement configure.log_level= :info is already written inside production.rb file, but i am not able to see rendered message logs unless I add another statement for :debug as well. I only want the rendered messages to be shown at info level and not on debug level. What is the way to do it? I think if we find out how rails decide which logs are info and which are not then we can do something about it. Help me out here. Thanks

1

There are 1 answers

4
eugen On

Any message shown on the info level will also appear at the debug level - see the ruby documentation for the Logger class.

If you are asking about which messages Rails shows on info and which are shown on debug, I don't think there's an easier way short of looking through the source code.

Similarly, if you're looking for logging statements inside your application code, search for logger.info or logger.debug.