2019-12-13 12:07:41 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
2019-12-16 12:07:43 +00:00
|
|
|
module ErrorTracking
|
2019-12-13 12:07:41 +00:00
|
|
|
class Logger < ::Gitlab::JsonLogger
|
2022-06-15 09:09:28 +00:00
|
|
|
def self.capture_exception(exception, **context_payload)
|
|
|
|
formatter = Gitlab::ErrorTracking::LogFormatter.new
|
|
|
|
log_hash = formatter.generate_log(exception, context_payload)
|
|
|
|
|
|
|
|
self.error(log_hash)
|
|
|
|
end
|
|
|
|
|
2019-12-13 12:07:41 +00:00
|
|
|
def self.file_name_noext
|
|
|
|
'exceptions_json'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|