mirror of
https://github.com/discourse/discourse.git
synced 2025-02-16 18:24:52 -06:00
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(
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user