Class: GetaroundUtils::Patches::KeyValueLogTags
- Inherits:
-
Object
- Object
- GetaroundUtils::Patches::KeyValueLogTags
- Defined in:
- lib/getaround_utils/patches/key_value_log_tags.rb
Overview
Augment the ActiveRecord::TaggedLogging tag formatting
Tags are defined either as String, Proc or a property of request
Originally they will be formatted as ‘[tag_value]` This patch will instead attempt to serialize the tag with GetaroundUtils::DeepKeyValueSerializer
ie:
- for a String `value` it would yield `"value"`
- for a Symbol `:request_id` it would yield `request_id="request_id_value"`
- for a Proc `-> {key: :val}` it would yield `key="value"`
Defined Under Namespace
Modules: RackLogger, TaggedLoggingFormatter
Class Method Summary collapse
Class Method Details
.enable ⇒ Object
49 50 51 52 |
# File 'lib/getaround_utils/patches/key_value_log_tags.rb', line 49 def self.enable ActiveSupport::TaggedLogging::Formatter.prepend TaggedLoggingFormatter Rails::Rack::Logger.prepend RackLogger end |