Skip to content

Instantly share code, notes, and snippets.

@stevecrozz
Created February 25, 2016 00:19
Show Gist options
  • Select an option

  • Save stevecrozz/cb55c521711a7858dc2f to your computer and use it in GitHub Desktop.

Select an option

Save stevecrozz/cb55c521711a7858dc2f to your computer and use it in GitHub Desktop.
# No good. Configuration options are bound to environment names
if ENV['RAILS_ENV'] == 'production' || ENV['RAILS_ENV'] =~ /integ|stage/
logger = RightSupport::Log::SystemLogger.new('my_service')
else
logger = Logger.new(STDOUT)
end
# Great! Easily controllable log location no matter what environment
if ENV['LOG_LOCATION'] == 'syslog'
logger = RightSupport::Log::SystemLogger.new('my_service')
else
logger = Logger.new(STDOUT)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment