Bug fix: Fix Ruby loggers by fixing log4j2 setup

Fixes #8339
This commit is contained in:
Jake Landis 2017-09-20 10:00:11 -05:00
parent 04e20fd7d4
commit 6744512f95

View file

@ -223,7 +223,9 @@ class LogStash::Runner < Clamp::StrictCommand
log4j_config_location = ::File.join(setting("path.settings"), "log4j2.properties")
# Windows safe way to produce a file: URI.
LogStash::Logging::Logger::reconfigure(URI.join("file:///" + File.absolute_path(log4j_config_location)).to_s)
file_schema = "file://" + (LogStash::Environment.windows? ? "/" : "")
LogStash::Logging::Logger::reconfigure(URI.join(file_schema + File.absolute_path(log4j_config_location)).to_s)
end
# override log level that may have been introduced from a custom log4j config file
LogStash::Logging::Logger::configure_logging(setting("log.level"))