mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
Always log backtrace for converge / pipeline exceptions
Previously users had to enable --log.level=debug to see backtraces. These errors catch everything which can make debugging based on user reports difficult if not impossible. Enabling --log.level=debug to solve these issues is not useful because users cannot enable it in production for rare errors. Fixes #8156
This commit is contained in:
parent
340e879379
commit
ffff418839
2 changed files with 9 additions and 13 deletions
|
@ -337,12 +337,13 @@ class LogStash::Agent
|
|||
|
||||
unless action_result.successful?
|
||||
logger.error("Failed to execute action", :id => action.pipeline_id,
|
||||
:action_type => action_result.class, :message => action_result.message)
|
||||
:action_type => action_result.class, :message => action_result.message,
|
||||
:backtrace => action_result.backtrace)
|
||||
end
|
||||
rescue SystemExit => e
|
||||
converge_result.add(action, e)
|
||||
rescue Exception => e
|
||||
logger.error("Failed to execute action", :action => action, :exception => e.class.name, :message => e.message)
|
||||
logger.error("Failed to execute action", :action => action, :exception => e.class.name, :message => e.message, :backtrace => e.backtrace)
|
||||
converge_result.add(action, e)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -578,17 +578,12 @@ module LogStash; class Pipeline < BasePipeline
|
|||
end
|
||||
|
||||
# otherwise, report error and restart
|
||||
if @logger.debug?
|
||||
@logger.error(I18n.t("logstash.pipeline.worker-error-debug",
|
||||
default_logging_keys(
|
||||
:plugin => plugin.inspect,
|
||||
:error => e.message,
|
||||
:exception => e.class,
|
||||
:stacktrace => e.backtrace.join("\n"))))
|
||||
else
|
||||
@logger.error(I18n.t("logstash.pipeline.worker-error",
|
||||
default_logging_keys(:plugin => plugin.inspect, :error => e.message)))
|
||||
end
|
||||
@logger.error(I18n.t("logstash.pipeline.worker-error-debug",
|
||||
default_logging_keys(
|
||||
:plugin => plugin.inspect,
|
||||
:error => e.message,
|
||||
:exception => e.class,
|
||||
:stacktrace => e.backtrace.join("\n"))))
|
||||
|
||||
# Assuming the failure that caused this exception is transient,
|
||||
# let's sleep for a bit and execute #run again
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue