diff --git a/logstash-core/lib/logstash/runner.rb b/logstash-core/lib/logstash/runner.rb index 0f45d8eee..f7dbf5cca 100644 --- a/logstash-core/lib/logstash/runner.rb +++ b/logstash-core/lib/logstash/runner.rb @@ -190,12 +190,6 @@ class LogStash::Runner < Clamp::StrictCommand @settings = LogStash::SETTINGS @bootstrap_checks = DEFAULT_BOOTSTRAP_CHECKS.dup - # Default we check local sources: `-e`, `-f` and the logstash.yml options. - @source_loader = LogStash::Config::SourceLoader.new(@settings) - @source_loader.add_source(LogStash::Config::Source::Local.new(@settings)) - @source_loader.add_source(LogStash::Config::Source::Modules.new(@settings)) - @source_loader.add_source(LogStash::Config::Source::MultiLocal.new(@settings)) - super(*args) end @@ -256,6 +250,12 @@ class LogStash::Runner < Clamp::StrictCommand return 0 end + # Default we check local sources: `-e`, `-f` and the logstash.yml options. + @source_loader = LogStash::Config::SourceLoader.new(@settings) + @source_loader.add_source(LogStash::Config::Source::Local.new(@settings)) + @source_loader.add_source(LogStash::Config::Source::Modules.new(@settings)) + @source_loader.add_source(LogStash::Config::Source::MultiLocal.new(@settings)) + # Add local modules to the registry before everything else LogStash::Modules::Util.register_local_modules(LogStash::Environment::LOGSTASH_HOME)