mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-23 19:20:47 +02:00
Update settings.py
This commit is contained in:
parent
a7b3fc71a5
commit
a128ebcf69
1 changed files with 2 additions and 0 deletions
|
@ -476,6 +476,8 @@ class JsonServerFormatter(ServerFormatter):
|
||||||
|
|
||||||
def format(self, record):
|
def format(self, record):
|
||||||
formatted_record = super().format(record)
|
formatted_record = super().format(record)
|
||||||
|
if not hasattr(record, "server_time"):
|
||||||
|
record.server_time = self.formatTime(record, self.datefmt)
|
||||||
log_entry = {"server_time": record.server_time, "level": record.levelname, "message": formatted_record}
|
log_entry = {"server_time": record.server_time, "level": record.levelname, "message": formatted_record}
|
||||||
return json.dumps(log_entry)
|
return json.dumps(log_entry)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue