You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
module Redirector
class Middleware
class Responder
def with_optional_silencing(&block)
if Redirector.silence_sql_logs
ActiveRecord::Base.silence { yield }
else
yield
end
end
end
end
end
I placed the above code in config/initializers/redirector.rb, restarted my rails server, and now the silence_sql_logs setting is respected.
The key is this line of code: ActiveRecord::Base.silence { yield }. Originally, it's ActiveRecord::Base.logger.silence { yield }.
I wouldn't mind making a pull request, though I'm not sure how to properly detect if/when this monkeypatch is necessary.
I have added
config.redirector.silence_sql_logs = true
to theconfig/application.rb
however, I am still getting many lines of this output in my logs.SQL (2.1ms) SELECT
redirect_rules.
idetc ...
The text was updated successfully, but these errors were encountered: