Skip to content

Commit 35d7c4a

Browse files
authored
Support TaggedLogging in Rails 7.1 (#21)
1 parent 6190e43 commit 35d7c4a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/logtail/logger.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ def build_log_entry(severity, time, progname, logged_obj)
5757

5858
# Because of all the crazy ways Rails has attempted tags, we need this crazy method.
5959
def extract_active_support_tagged_logging_tags
60-
if defined?(ActiveSupport::IsolatedExecutionState)
61-
@current_tags ||= ActiveSupport::IsolatedExecutionState[tagged_logging_object_key_name]
60+
if defined?(current_tags)
61+
return current_tags
6262
end
6363

64-
@current_tags ||
64+
defined?(ActiveSupport::IsolatedExecutionState) && ActiveSupport::IsolatedExecutionState[tagged_logging_object_key_name] ||
6565
Thread.current[:activesupport_tagged_logging_tags] ||
6666
Thread.current[tagged_logging_object_key_name] ||
6767
EMPTY_ARRAY

lib/logtail/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Logtail
2-
VERSION = "0.1.10"
2+
VERSION = "0.1.11"
33
end

0 commit comments

Comments
 (0)