2018-10-22 03:00:50 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2012-09-11 16:24:53 -04:00
|
|
|
module Gitlab
|
2020-01-13 16:07:39 -05:00
|
|
|
class AppLogger < Gitlab::MultiDestinationLogger
|
|
|
|
LOGGERS = [Gitlab::AppTextLogger, Gitlab::AppJsonLogger].freeze
|
|
|
|
|
|
|
|
def self.loggers
|
2020-08-13 17:10:04 -04:00
|
|
|
if Gitlab::Utils.to_boolean(ENV.fetch('UNSTRUCTURED_RAILS_LOG', 'true'))
|
|
|
|
LOGGERS
|
|
|
|
else
|
|
|
|
[Gitlab::AppJsonLogger]
|
|
|
|
end
|
2012-09-11 16:24:53 -04:00
|
|
|
end
|
|
|
|
|
2020-01-13 16:07:39 -05:00
|
|
|
def self.primary_logger
|
|
|
|
Gitlab::AppTextLogger
|
2012-09-11 16:24:53 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|