lib/loggery/controller/logging_context.rb in loggery-0.1.0 vs lib/loggery/controller/logging_context.rb in loggery-0.2.0
- old
+ new
@@ -1,7 +1,9 @@
# frozen_string_literal: true
+require "active_support/concern"
+
# Provides a hook in Rails controllers that allows enriching log lines from within a Rails request
# with data that is available only within a controller action, for instance user information.
module Loggery
module Controller
@@ -17,9 +19,10 @@
{}
end
def loggery_set_metadata
return unless Loggery::Metadata::Store.store
+
metadata = loggery_default_metadata.merge loggery_log_context
Loggery::Metadata::Store.store.merge!(metadata)
end
def loggery_default_metadata