Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What levels of logging are available for Heroku?

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?

like image 587
Jasper Kennis Avatar asked May 13 '12 21:05

Jasper Kennis


People also ask

Which of these are levels of logging?

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.

What are Heroku logs?

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.

What is the default logging level?

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.


1 Answers

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

like image 171
izumi Avatar answered Oct 25 '22 02:10

izumi