Skip to content

Commit

Permalink
Fix TaggedLogging in Rails 7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrHeinz committed Jul 12, 2023
1 parent e0ba5e2 commit 86bf32c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/logtail/logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ 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]
end

@current_tags ||
Thread.current[:activesupport_tagged_logging_tags] ||
Thread.current[tagged_logging_object_key_name] ||
Expand Down

0 comments on commit 86bf32c

Please sign in to comment.