EXPERIMENTAL: Allow logs to be shipped via different methods.

See https://github.com/dwbutler/logstash-logger#uri-configuration for
a list of available methods.
This commit is contained in:
Guo Xiang Tan
2017-11-14 12:50:26 +08:00
parent 0d8e9a88c9
commit 89d9ffa884
7 changed files with 30 additions and 63 deletions

View File

@@ -1,10 +1,8 @@
# See http://unicorn.bogomips.org/Unicorn/Configurator.html
if ENV["UNICORN_JSON_LOG_FORMAT"]
unicorn_logger = Logger.new($stderr)
require_relative '../lib/unicorn/unicorn_json_log_formatter'
unicorn_logger.formatter = UnicornJSONLogFormatter.new
logger unicorn_logger
if ENV["LOGSTASH_URI"]
require_relative '../lib/discourse_logstash_logger'
logger DiscourseLogstashLogger.logger(uri: ENV['LOGSTASH_URI'], type: :unicorn)
end
# enable out of band gc out of the box, it is low risk and improves perf a lot