Created
February 6, 2014 19:20
-
-
Save tokenvolt/8850823 to your computer and use it in GitHub Desktop.
Sidekiq logger
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
Sidekiq.logger.formatter = proc do |severity, timestamp, context, message| | |
case severity | |
when 'INFO' | |
severity = severity.green | |
when 'ERROR' | |
severity = severity.red | |
else 'WARN' | |
severity = severity.yellow | |
end | |
"#{timestamp.utc.iso8601} #{Process.pid} TID-#{Thread.current.object_id.to_s(36)}#{context} #{severity}: #{message}\n" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment