Module: ActiveSupport

Defined in:
lib/log_struct/monkey_patches/active_support/tagged_logging/formatter.rb

Overview

Monkey-patch ActiveSupport::TaggedLogging::Formatter to work with structured logging.

Problem: Rails' TaggedLogging prepends tags as text and converts messages to strings. When we pass a hash to super(), Rails does "#tags_text#msg" which calls .to_s on the hash, producing Ruby inspect format "..." instead of valid JSON.

Solution: When LogStruct is enabled, we add tags as a hash entry and delegate to LogStruct::Formatter for proper JSON serialization with filtering and standard fields.

Defined Under Namespace

Modules: TaggedLogging