Class: JsonLogging::Formatter
- Inherits:
-
Logger::Formatter
- Object
- Logger::Formatter
- JsonLogging::Formatter
- Defined in:
- lib/json_logging/formatter.rb
Instance Attribute Summary collapse
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
- #call(severity, timestamp, progname, msg) ⇒ Object
-
#initialize(tags: []) ⇒ Formatter
constructor
A new instance of Formatter.
Constructor Details
Instance Attribute Details
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
8 9 10 |
# File 'lib/json_logging/formatter.rb', line 8 def @tags end |
Instance Method Details
#call(severity, timestamp, progname, msg) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/json_logging/formatter.rb', line 10 def call(severity, , progname, msg) LineEncoder.build_line( msg: msg, severity: severity, timestamp: Helpers.(), tags: @tags, additional_context: JsonLogging.additional_context_for_payload, additional_context_sanitized: true, sanitize_tags: false ) rescue => e build_fallback_output(severity, , msg, e) end |