From 35d7c4a17feebb7e58581c357f497fedb5d73d1d Mon Sep 17 00:00:00 2001 From: Petr Heinz Date: Fri, 4 Aug 2023 15:26:13 +0200 Subject: [PATCH] Support TaggedLogging in Rails 7.1 (#21) --- lib/logtail/logger.rb | 6 +++--- lib/logtail/version.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/logtail/logger.rb b/lib/logtail/logger.rb index febee99..c2dc67f 100755 --- a/lib/logtail/logger.rb +++ b/lib/logtail/logger.rb @@ -57,11 +57,11 @@ def build_log_entry(severity, time, progname, logged_obj) # Because of all the crazy ways Rails has attempted tags, we need this crazy method. def extract_active_support_tagged_logging_tags - if defined?(ActiveSupport::IsolatedExecutionState) - @current_tags ||= ActiveSupport::IsolatedExecutionState[tagged_logging_object_key_name] + if defined?(current_tags) + return current_tags end - @current_tags || + defined?(ActiveSupport::IsolatedExecutionState) && ActiveSupport::IsolatedExecutionState[tagged_logging_object_key_name] || Thread.current[:activesupport_tagged_logging_tags] || Thread.current[tagged_logging_object_key_name] || EMPTY_ARRAY diff --git a/lib/logtail/version.rb b/lib/logtail/version.rb index d05ec82..b320866 100755 --- a/lib/logtail/version.rb +++ b/lib/logtail/version.rb @@ -1,3 +1,3 @@ module Logtail - VERSION = "0.1.10" + VERSION = "0.1.11" end