New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
on the test server, write ruby errors to cloudwatch and honeybadger #57662
Conversation
test: | ||
report_data: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax derived from these sources:
if CDO.running_web_application? | ||
# Use default logging formatter so that PID and timestamp are not suppressed. | ||
config.log_formatter = Logger::Formatter.new | ||
|
||
# Log condensed lines to syslog for centralized logging. | ||
config.lograge.enabled = true | ||
config.lograge.formatter = Lograge::Formatters::Cee.new | ||
require 'syslog/logger' | ||
config.logger = Syslog::Logger.new 'dashboard', Syslog::LOG_LOCAL0 | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar logging config to other environments, but limited to running web app to make sure it does not get set in unit tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 in particular, very similar to the config for production.rb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me - generally like leaning into honeybadger.
if CDO.running_web_application? | ||
# Use default logging formatter so that PID and timestamp are not suppressed. | ||
config.log_formatter = Logger::Formatter.new | ||
|
||
# Log condensed lines to syslog for centralized logging. | ||
config.lograge.enabled = true | ||
config.lograge.formatter = Lograge::Formatters::Cee.new | ||
require 'syslog/logger' | ||
config.logger = Syslog::Logger.new 'dashboard', Syslog::LOG_LOCAL0 | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 in particular, very similar to the config for production.rb
today it is difficult to debug server errors on the test machine. this is especially bad when working with Active Job, because there is no easy way to surface these errors in the UI. Logs are currently written to dashboard/log/test.log, in rails format, which does not include a timestamp:
This config change makes the logs show up in cloudwatch and also includes a timestamp in /var/log/syslog:
f5c0597 also makes the error details show up in honey badger.
Testing story
patched onto the test machine, and verified that new ruby errors appear in:
test-syslog
group in cloudwatch