diff --git a/logstash-core/lib/logstash/environment.rb b/logstash-core/lib/logstash/environment.rb index 2f36a0835af..8e305ebb0a4 100644 --- a/logstash-core/lib/logstash/environment.rb +++ b/logstash-core/lib/logstash/environment.rb @@ -133,7 +133,7 @@ module Environment # Windows safe way to produce a file: URI. file_schema = "file://" + (LogStash::Environment.windows? ? "/" : "") - LogStash::Logging::Logger::reconfigure(::URI.encode_www_form_component(file_schema + ::File.absolute_path(log4j_config_location))) + LogStash::Logging::Logger::reconfigure(::URI::Parser.new.escape(file_schema + ::File.absolute_path(log4j_config_location))) end # override log level that may have been introduced from a custom log4j config file LogStash::Logging::Logger::configure_logging(settings.get("log.level"))