logging: Show timestamp in UTC in non-django production scripts.

Done in pair programming with @aero31aero.

Fixes #9678.
This commit is contained in:
Abhilash Verma
2018-08-12 05:26:58 +05:30
committed by Tim Abbott
parent 920ef2b7f7
commit 0e2322a322
7 changed files with 12 additions and 0 deletions

View File

@@ -465,6 +465,8 @@ def clear_scheduled_emails(user_id: int, email_type: Optional[int]=None) -> None
def log_digest_event(msg: str) -> None:
import logging
import time
logging.Formatter.converter = time.gmtime
logging.basicConfig(filename=settings.DIGEST_LOG_PATH, level=logging.INFO)
logging.info(msg)