问题
I have an application in another TIME_ZONE
, but I want to keep all generated logs in UTC.
I already defined my own Formatter for Python logging, and all logger calls that I have throughout the app, are all using UTC, but django.request logs, are still using locale's app timezone (both logs bellow, were generated by a single request):
Django Request Logger:
[10/Jun/2020 16:59:52] "POST /api/v1/report/ HTTP/1.1" 200 761
Application Logger:
[10/Jun/2020 23:00:02] INFO - REPORT_OK {'country': 'USA', 'ip': '127.0.0.1'}
How can I apply a similar approach to django.request logger?
来源:https://stackoverflow.com/questions/62314586/how-to-convert-django-request-logger-time-to-utc