Fix missing log4j2.properties file on Windows

fix Issue #6352

On Windows, Logstash can't find log4j2.properties file with above message at startup.
```
Could not find log4j2 configuration at path /LS_HOME/config/log4j2.properties.
```

Fixes #6903
This commit is contained in:
TAC 2017-04-11 16:57:53 +09:00 committed by Suyog Rao
parent edd1b40de7
commit 4bfb8c403b

View file

@ -195,7 +195,7 @@ class LogStash::Runner < Clamp::StrictCommand
java.lang.System.setProperty("ls.log.level", setting("log.level")) java.lang.System.setProperty("ls.log.level", setting("log.level"))
unless java.lang.System.getProperty("log4j.configurationFile") unless java.lang.System.getProperty("log4j.configurationFile")
log4j_config_location = ::File.join(setting("path.settings"), "log4j2.properties") log4j_config_location = ::File.join(setting("path.settings"), "log4j2.properties")
LogStash::Logging::Logger::initialize("file://" + log4j_config_location) LogStash::Logging::Logger::initialize("file:///" + log4j_config_location)
end end
# override log level that may have been introduced from a custom log4j config file # override log level that may have been introduced from a custom log4j config file
LogStash::Logging::Logger::configure_logging(setting("log.level")) LogStash::Logging::Logger::configure_logging(setting("log.level"))