Description
app/models/health_check.rb line 163 uses puts to output error backtraces:
rescue Exception => e
# ...
puts e.backtrace
end
Impact
puts writes to $stdout. In production (Heroku, systemd, containers), $stdout may be redirected, buffered, or discarded depending on the process manager.
- The backtrace never appears in Rails logs (
log/production.log), so errors are invisible to anyone watching the log file.
- Log aggregation tools (Papertrail, Datadog) typically capture
Rails.logger output, not raw $stdout.
- The backtrace is printed without context (which check, which check_run ID).
Suggested approach
Rails.logger.error "[HealthCheck ##{id}] #{e.class}: #{e.message}"
Rails.logger.error e.backtrace.join("\n")
Or use an exception tracking service (Sentry, Honeybadger): Sentry.capture_exception(e).
Effort: trivial
Description
app/models/health_check.rbline 163 usesputsto output error backtraces:Impact
putswrites to $stdout. In production (Heroku, systemd, containers), $stdout may be redirected, buffered, or discarded depending on the process manager.log/production.log), so errors are invisible to anyone watching the log file.Rails.loggeroutput, not raw $stdout.Suggested approach
Or use an exception tracking service (Sentry, Honeybadger):
Sentry.capture_exception(e).Effort: trivial