lib/syslogstash.rb in syslogstash-0.4.1 vs lib/syslogstash.rb in syslogstash-1.0.0
- old
+ new
@@ -10,11 +10,11 @@
def initialize(sockets, servers, backlog)
@metrics = PrometheusExporter.new
@writer = LogstashWriter.new(servers, backlog, @metrics)
- @readers = sockets.map { |f, tags| SyslogReader.new(f, tags, @writer, @metrics) }
+ @readers = sockets.map { |f, cfg| SyslogReader.new(f, cfg, @writer, @metrics) }
end
def run
@metrics.run
@writer.run
@@ -23,22 +23,22 @@
tw = ThreadsWait.new(@metrics.thread, @writer.thread, *(@readers.map { |r| r.thread }))
dead_thread = tw.next_wait
if dead_thread == @writer.thread
- $stderr.puts "Writer thread crashed."
+ $stderr.puts "[Syslogstash] Writer thread crashed."
elsif dead_thread == @metrics.thread
- $stderr.puts "Metrics exporter thread crashed."
+ $stderr.puts "[Syslogstash] Metrics exporter thread crashed."
else
reader = @readers.find { |r| r.thread == dead_thread }
- $stderr.puts "Reader thread for #{reader.file} crashed."
+ $stderr.puts "[Syslogstash] Reader thread for #{reader.file} crashed."
end
begin
dead_thread.join
rescue Exception => ex
- $stderr.puts "Exception in thread was: #{ex.message} (#{ex.class})"
+ $stderr.puts "[Syslogstash] Exception in thread was: #{ex.message} (#{ex.class})"
$stderr.puts ex.backtrace.map { |l| " #{l}" }.join("\n")
end
exit 1
end