Continue to log to Rails default log file when LogStashLogger is

enabled.
This commit is contained in:
Guo Xiang Tan 2017-10-28 00:30:11 +08:00
parent 53cadbdfc5
commit fba0c9e51e
1 changed files with 8 additions and 1 deletions

View File

@ -22,7 +22,14 @@ if (Rails.env.production? && SiteSetting.logging_provider == 'lograge') || ENV["
require 'logstash-logger'
config.lograge.formatter = Lograge::Formatters::Logstash.new
config.lograge.logger = LogStashLogger.new(uri: logstash_uri)
config.lograge.logger = LogStashLogger.new(
type: :multi_delegator,
outputs: [
{ uri: logstash_uri },
{ type: :file, path: "#{Rails.root}/log/#{Rails.env}.log" }
]
)
end
end
end