6

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?

Jasper Kennis
  • 3,225
  • 6
  • 41
  • 74

2 Answers2

16

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

izumi
  • 211
  • 3
  • 5
  • There is also the "unknown" level. Check here: http://guides.rubyonrails.org/debugging_rails_applications.html#log-levels – Hugo Dec 16 '15 at 14:13
1

Logging on Heroku is just a stream of text lines. So you can log anything you want. You can also filter through that stream, use add-ons for enhanced search, and get a syslog drain of your logs.

James Ward
  • 29,283
  • 9
  • 49
  • 85
  • Hm, maybe my question wasn't really clear. Using `heroku config:add LOG_LEVEL=DEBUG` you can change the logging level. I was woundering what I could use instead of "DEBUG" or "INFO". – Jasper Kennis May 14 '12 at 08:31
  • This depends on the logging framework you are using. What language and logging library are you using? – James Ward May 14 '12 at 12:29