fix shutdown watcher reports

since 5.x introduced log4j2 as the main logging mechanism, it's
necessary to be more explicit when logging complex objects.

In this case we tell the logger to use the .to_s version of the Snapshot
report generated by the Watcher.
The Snapshot#to_s calls .to_simple_hash.to_s

Fixes #6628
This commit is contained in:
Joao Duarte 2017-02-02 12:11:59 +00:00 committed by João Duarte
parent 8de53a096f
commit fe885a4a11

View file

@ -44,7 +44,7 @@ module LogStash
@reports << pipeline_report_snapshot
@reports.delete_at(0) if @reports.size > @report_every # expire old report
if cycle_number == (@report_every - 1) # it's report time!
logger.warn(@reports.last)
logger.warn(@reports.last.to_s)
if shutdown_stalled?
logger.error("The shutdown process appears to be stalled due to busy or blocked plugins. Check the logs for more information.") if stalled_count == 0