delayed_job
delayed_job copied to clipboard
Don't log time, logger can be formatted to include time
Summary
Including time in logger pollutes loggers that already have a timestamp included. Developers can set their own logger through Delayed::Worker.logger
. Additionally, common logging platforms are able to determine time on ingestion such as Cloudwatch, Datadog, Scalyr, etc.
Background
This pr initially included time 10 years ago when Rails didn't support time in logs: https://github.com/collectiveidea/delayed_job/issues/37. 5 years later, this issue was opened asking for the same fix https://github.com/collectiveidea/delayed_job/pull/859 but Rails still did not support it. Now, this is possible with Rails loggers using your own logger and setting Rails.logger.datetime_format
to your own desired format, see https://stackify.com/rails-logger-and-rails-logging-best-practices/ for examples/tutorial.
@albus522 have time to review?