Class: Istox::Logging::LogFormatter
- Inherits:
-
Object
- Object
- Istox::Logging::LogFormatter
- Defined in:
- lib/istox/logging/log_formatter.rb
Instance Method Summary collapse
Instance Method Details
#call(severity, time, progname, msg = '') ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/istox/logging/log_formatter.rb', line 5 def call(severity, time, progname, msg='') return '' if msg.blank? hash = { level: severity, message: (msg) } if progname.present? hash[:app] = progname end return hash.to_json + "\n" # return "timestamp='#{time}' level=#{severity} progname='#{progname}' #{processed_message(msg)}\n" if progname.present? # "timestamp='#{time}' level=#{severity} #{processed_message(msg)}\n" end |