lib/fluent/engine.rb in fluentd-0.10.38 vs lib/fluent/engine.rb in fluentd-0.10.39

- old
+ new

@@ -29,10 +29,12 @@ @log_event_loop_stop = false @log_event_queue = [] @suppress_emit_error_log_interval = 0 @next_emit_error_log_time = nil + + @suppress_config_dump = false end MATCH_CACHE_SIZE = 1024 LOG_EMIT_INTERVAL = 0.1 @@ -52,30 +54,36 @@ def suppress_interval(interval_time) @suppress_emit_error_log_interval = interval_time @next_emit_error_log_time = Time.now.to_i end + def suppress_config_dump=(flag) + @suppress_config_dump = flag + end + def read_config(path) $log.info "reading config file", :path=>path File.open(path) {|io| parse_config(io, File.basename(path), File.dirname(path)) } end def parse_config(io, fname, basepath=Dir.pwd) conf = if fname =~ /\.rb$/ - Config::DSL::DSLParser.parse(io, fname) + Config::DSL::Parser.parse(io, File.join(basepath, fname)) else Config.parse(io, fname, basepath) end configure(conf) conf.check_not_fetched {|key,e| $log.warn "parameter '#{key}' in #{e.to_s.strip} is not used." } end def configure(conf) - $log.info "using configuration file: #{conf.to_s.rstrip}" + unless @suppress_config_dump + $log.info "using configuration file: #{conf.to_s.rstrip}" + end conf.elements.select {|e| e.name == 'source' }.each {|e| type = e['type']