2020-01-01 13:55:28 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module ErrorTracking
|
|
|
|
class Logger < ::Gitlab::JsonLogger
|
2022-07-23 23:45:48 +05:30
|
|
|
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
|
|
|
|
|
2020-01-01 13:55:28 +05:30
|
|
|
def self.file_name_noext
|
|
|
|
'exceptions_json'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|