Replace ActiveSupport::Logger with DiscourseLogstashLogger when enabled.
This commit is contained in:
parent
e43baafa02
commit
a902d5b27f
|
@ -96,6 +96,11 @@ if (Rails.env.production? && SiteSetting.logging_provider == 'lograge') || ENV["
|
||||||
config.lograge.logger = DiscourseLogstashLogger.logger(
|
config.lograge.logger = DiscourseLogstashLogger.logger(
|
||||||
uri: ENV['LOGSTASH_URI'], type: :rails
|
uri: ENV['LOGSTASH_URI'], type: :rails
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Remove ActiveSupport::Logger from the chain and replace with Lograge's
|
||||||
|
# logger
|
||||||
|
Rails.logger.instance_variable_get(:@chained).pop
|
||||||
|
Rails.logger.chain(config.lograge.logger)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue