I have a Rails app running on Heroku, it runs fine. I had it running with debug level logging, but now I switched back to INFO. What other levels of debugging are available? And when running for production, what level of logging should I use?
Logging levels explained. The most common logging levels include FATAL, ERROR, WARN, INFO, DEBUG, TRACE, ALL, and OFF. Some of them are important, others less important, while others are meta-considerations.
A Heroku app's logs come from the output streams of all of its running processes, system components, and backing services. Heroku's Logplex routes log streams from all sources into a single channel, providing a foundation for comprehensive logging.
The default level for all loggers is Inherit, and the default level for the root logger is Info. Do not turn on Debug or higher logging without direction from technical support. Turning on this excessive logging for high volume module like system, query, or exec can rapidly flood your system and terminate the servers.
On Heroku you can set your log level by using the LOG_LEVEL environment variable
$ heroku config:set LOG_LEVEL=DEBUG
Valid values include DEBUG, INFO, WARN, ERROR, and FATAL. Alternatively you can set this value in your environment config:
config.log_level = :debug
If both are set LOG_LEVEL will take precedence. You'll most likely want INFO in production.
See the rails-stdout-logging gem
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With