delayed_job icon indicating copy to clipboard operation
delayed_job copied to clipboard

Don't log time, logger can be formatted to include time

Open jshah opened this issue 3 years ago • 1 comments

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.

jshah avatar Aug 28 '21 21:08 jshah

@albus522 have time to review?

jshah avatar Sep 01 '21 17:09 jshah