Class: EIVO::Formatter
- Inherits:
-
Logger::Formatter
- Object
- Logger::Formatter
- EIVO::Formatter
- Defined in:
- lib/eivo-rails-api/formatter.rb
Instance Method Summary collapse
Instance Method Details
#call(severity, timestamp, progname, message) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/eivo-rails-api/formatter.rb', line 8 def call(severity, , progname, ) json = { pid: $PROCESS_ID, level: severity, timestamp: .utc.iso8601(3), message: } if progname json[:tag] = progname end if defined?(::Sidekiq) context = ::Sidekiq::Context.current if !context.empty? json[:context] = context end end MultiJson.dump(json) << "\n" end |