Fix incorrect URI for LogstashLogger.

This commit is contained in:
Guo Xiang Tan 2017-10-27 23:52:36 +08:00
parent afdd31473d
commit 8b12a906c6
1 changed files with 2 additions and 6 deletions

View File

@ -4,7 +4,7 @@ if (Rails.env.production? && SiteSetting.logging_provider == 'lograge') || ENV["
Rails.application.configure do Rails.application.configure do
config.lograge.enabled = true config.lograge.enabled = true
logstash_uri = ENV["LOGSTASH_URI"].present? logstash_uri = ENV["LOGSTASH_URI"]
config.lograge.custom_options = lambda do |event| config.lograge.custom_options = lambda do |event|
exceptions = %w(controller action format id) exceptions = %w(controller action format id)
@ -22,11 +22,7 @@ if (Rails.env.production? && SiteSetting.logging_provider == 'lograge') || ENV["
require 'logstash-logger' require 'logstash-logger'
config.lograge.formatter = Lograge::Formatters::Logstash.new config.lograge.formatter = Lograge::Formatters::Logstash.new
config.lograge.logger = LogStashLogger.new(uri: logstash_uri)
config.lograge.logger = LogStashLogger.new(
type: :tcp,
uri: logstash_uri
)
end end
end end
end end