lib/fluent/plugin/in_systemd.rb in fluent-plugin-systemd-0.0.4 vs lib/fluent/plugin/in_systemd.rb in fluent-plugin-systemd-0.0.5

- old
+ new

@@ -52,11 +52,16 @@ def read_from read_from_head ? :head : :tail end def run + Thread.current.abort_on_exception = true watch do |entry| - router.emit(tag, entry.realtime_timestamp.to_i, formatted(entry)) + begin + router.emit(tag, entry.realtime_timestamp.to_i, formatted(entry)) + rescue => e + log.error("Exception emitting record: #{e}") + end end end def formatted(entry) return entry.to_h unless strip_underscores