File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
lib/rails_semantic_logger Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -127,8 +127,10 @@ class Engine < ::Rails::Engine
127
127
128
128
# After any initializers run, but after the gems have been loaded
129
129
config . after_initialize do
130
+ config = Rails . application . config
131
+
130
132
# Replace the Bugsnag logger
131
- Bugsnag . configure { |config | config . logger = SemanticLogger [ Bugsnag ] } if defined? ( Bugsnag )
133
+ Bugsnag . configure { |bugsnag_config | bugsnag_config . logger = SemanticLogger [ Bugsnag ] } if defined? ( Bugsnag )
132
134
133
135
# Rails Patches
134
136
require ( "rails_semantic_logger/extensions/action_cable/tagged_logger_proxy" ) if defined? ( ::ActionCable )
@@ -174,7 +176,8 @@ class Engine < ::Rails::Engine
174
176
175
177
# Silence asset logging by applying a filter to the Rails logger itself, not any of the appenders.
176
178
if config . rails_semantic_logger . quiet_assets && config . assets . prefix
177
- assets_regex = %r(\A /{0,2}#{ config . assets . prefix } )
179
+ assets_root = config . relative_url_root . to_s + config . assets . prefix
180
+ assets_regex = %r(\A /{0,2}#{ assets_root } )
178
181
RailsSemanticLogger ::Rack ::Logger . logger . filter = -> ( log ) { log . payload [ :path ] !~ assets_regex if log . payload }
179
182
end
180
183
You can’t perform that action at this time.
0 commit comments