Created
September 17, 2011 23:14
-
-
Save sevennineteen/1224478 to your computer and use it in GitHub Desktop.
Set logger level on Heroku Sinatra app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "logger" | |
configure do | |
LOG = Logger.new(STDOUT) | |
LOG.level = Logger.const_get ENV['LOG_LEVEL'] || 'DEBUG' | |
LOG.info 'I am logging something.' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On Heroku, set the desired log level as a config var:
This is read from
ENV['LOG_LEVEL']
within the app.