Module: Lumberjack::Rails::TaggedLoggingFormatter
- Defined in:
- lib/lumberjack/rails/tagged_logging_formatter.rb
Overview
Extension for the Lumberjack::EntryFormatter that adds support for adding the array of tags added by ActiveSupport::TaggedLogging.
This module integrates ActiveSupport’s tagged logging mechanism with Lumberjack’s entry formatting, ensuring that tags from Rails’ tagged logging are properly included in the formatted log output.
Instance Method Summary collapse
-
#format(message, tags) ⇒ String
Format a log message with support for ActiveSupport tagged logging.
Instance Method Details
#format(message, tags) ⇒ String
Format a log message with support for ActiveSupport tagged logging.
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/lumberjack/rails/tagged_logging_formatter.rb', line 16 def format(, ) tagged_values = if respond_to?(:current_tags) if tagged_values && !tagged_values.empty? tagged = {"tags" => tagged_values} = .nil? ? tagged : .merge(tagged) else = end super(, ) end |