Skip to content

Instantly share code, notes, and snippets.

@blairio
Last active December 17, 2015 21:59

Revisions

  1. blairio revised this gist May 30, 2013. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions put_in_application.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    if Rails.env[/production|staging/]
    config.logger = Logger.new(STDOUT)
    config.logger.level = Logger.const_get(ENV['LOG_LEVEL'] ? ENV['LOG_LEVEL'].upcase : 'INFO')
    end
  2. blairio created this gist May 30, 2013.
    6 changes: 6 additions & 0 deletions simple_formatter.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    class Logger::SimpleFormatter
    # This method is invoked when a log event occurs
    def call(severity, timestamp, progname, msg)
    "[#{severity}] [#{$$}] #{String === msg ? msg : msg.inspect}\n"
    end
    end