improve error logging for warn_exception

This commit is contained in:
Sam 2018-01-05 09:54:28 +11:00
parent 0081de30a5
commit 25f4d98307

View File

@ -446,6 +446,10 @@ module Discourse
# report a warning maintaining backtrack for logster
def self.warn_exception(e, message: "", env: nil)
if Rails.logger.respond_to? :add_with_opts
env ||= {}
env[:current_db] ||= RailsMultisite::ConnectionManagement.current_db
# logster
Rails.logger.add_with_opts(
::Logger::Severity::WARN,