mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
parent
f5480128f7
commit
dde2730d10
3 changed files with 3 additions and 7 deletions
|
@ -73,7 +73,7 @@ module LogStash
|
|||
raise ArgumentError, "invalid level[#{level}] for logger[#{path}]"
|
||||
end
|
||||
|
||||
def self.initialize(config_location)
|
||||
def self.reconfigure(config_location)
|
||||
@@config_mutex.synchronize do
|
||||
config_location_uri = URI.create(config_location)
|
||||
file_path = config_location_uri.path
|
||||
|
|
|
@ -249,7 +249,7 @@ class LogStash::Runner < Clamp::StrictCommand
|
|||
java.lang.System.setProperty("ls.log.level", setting("log.level"))
|
||||
unless java.lang.System.getProperty("log4j.configurationFile")
|
||||
log4j_config_location = ::File.join(setting("path.settings"), "log4j2.properties")
|
||||
LogStash::Logging::Logger::initialize("file:///" + log4j_config_location)
|
||||
LogStash::Logging::Logger::reconfigure("file:///" + log4j_config_location)
|
||||
end
|
||||
# override log level that may have been introduced from a custom log4j config file
|
||||
LogStash::Logging::Logger::configure_logging(setting("log.level"))
|
||||
|
|
|
@ -35,7 +35,7 @@ describe LogStash::Runner do
|
|||
allow(LogStash::Logging::Logger).to receive(:configure_logging) do |level, path|
|
||||
allow(logger).to receive(:level).and_return(level.to_sym)
|
||||
end
|
||||
|
||||
allow(LogStash::Logging::Logger).to receive(:reconfigure).with(any_args)
|
||||
# Make sure we don't start a real pipeline here.
|
||||
# because we cannot easily close the pipeline
|
||||
allow(LogStash::Agent).to receive(:new).with(any_args).and_return(agent)
|
||||
|
@ -43,10 +43,6 @@ describe LogStash::Runner do
|
|||
allow(agent).to receive(:shutdown)
|
||||
end
|
||||
|
||||
after :each do
|
||||
LogStash::Logging::Logger::configure_logging("info")
|
||||
end
|
||||
|
||||
describe "argument precedence" do
|
||||
let(:config) { "input {} output {}" }
|
||||
let(:cli_args) { ["-e", config, "-w", "20"] }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue