简体   繁体   中英

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

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

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM