Skip to content

Commit

Permalink
feat(minor): log datetime in worker log (backport #20414) (#20569)
Browse files Browse the repository at this point in the history
* feat(minor): log datetime in worker log  (#20414)

(cherry picked from commit c5cfe8f)

# Conflicts:
#	frappe/utils/background_jobs.py

* chore: resolve conflicts

* chore: fix linter

---------

Co-authored-by: Bernhard Sirlinger <WebsiteDeveloper@users.noreply.github.com>
Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com>
  • Loading branch information
3 people committed Apr 4, 2023
1 parent 8ae4d55 commit dccb6af
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frappe/utils/background_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,11 @@ def start_worker(queue=None, quiet=False):
logging_level = "INFO"
if quiet:
logging_level = "WARNING"
Worker(queues, name=get_worker_name(queue)).work(logging_level=logging_level)
Worker(queues, name=get_worker_name(queue)).work(
logging_level=logging_level,
date_format="%Y-%m-%d %H:%M:%S",
log_format="%(asctime)s,%(msecs)03d %(message)s",
)


def get_worker_name(queue):
Expand Down

0 comments on commit dccb6af

Please sign in to comment.