diff --git a/lib/fluent/supervisor.rb b/lib/fluent/supervisor.rb index 382b7f62f6..3166cd0554 100644 --- a/lib/fluent/supervisor.rb +++ b/lib/fluent/supervisor.rb @@ -1104,12 +1104,6 @@ def build_system_config(conf) opt = {} Fluent::SystemConfig::SYSTEM_CONFIG_PARAMETERS.each do |param| if @cl_opt.key?(param) && !@cl_opt[param].nil? - if param == :log_level && @cl_opt[:log_level] == Fluent::Log::LEVEL_INFO - # info level can't be specified via command line option. - # log_level is info here, it is default value and 's log_level should be applied if exists. - next - end - opt[param] = @cl_opt[param] end end diff --git a/test/command/test_fluentd.rb b/test/command/test_fluentd.rb index a905dcc9b1..2b9f8f71a2 100644 --- a/test/command/test_fluentd.rb +++ b/test/command/test_fluentd.rb @@ -1220,5 +1220,17 @@ def multi_workers_ready?; true; end "[error]", patterns_not_match: ["[warn]"]) end + + test 'system config one should not be overwritten when cmd line one is not specified' do + conf = < + log_level debug + +CONF + conf_path = create_conf_file('debug.conf', conf) + assert File.exist?(conf_path) + assert_log_matches(create_cmdline(conf_path), + "[debug]") + end end end