newrelic: refactor error logging.
* Factor out New Relic logging to DanbooruLogger class. * Log all exceptions to New Relic, not just statement timeouts.
This commit is contained in:
@@ -41,13 +41,7 @@ module Maintenance
|
||||
end
|
||||
|
||||
def rescue_exception(exception)
|
||||
backtrace = Rails.backtrace_cleaner.clean(exception.backtrace).join("\n")
|
||||
Rails.logger.error("#{exception.class}: #{exception.message}\n#{backtrace}")
|
||||
|
||||
if defined?(NewRelic::Agent)
|
||||
NewRelic::Agent.notice_error(exception, custom_params: { backtrace: backtrace })
|
||||
end
|
||||
|
||||
DanbooruLogger.log(exception)
|
||||
raise exception
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user