Skip to content

Commit

Permalink
Revert "fix: Avoid loading Django settings in Gunicorn (#3685)"
Browse files Browse the repository at this point in the history
This reverts commit 7c65445.
  • Loading branch information
matthewelwell committed Mar 28, 2024
1 parent d6ab996 commit 7ede5fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/util/logging.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import json
import logging
import os
import sys
from datetime import datetime
from typing import Any

from django.conf import settings
from gunicorn.config import Config
from gunicorn.glogging import Logger as GunicornLogger

Expand Down Expand Up @@ -54,7 +54,7 @@ def get_json_record(self, record: logging.LogRecord) -> dict[str, Any]:
class GunicornJsonCapableLogger(GunicornLogger):
def setup(self, cfg: Config) -> None:
super().setup(cfg)
if os.getenv("LOG_FORMAT") == "json":
if settings.LOG_FORMAT == "json":
self._set_handler(
self.error_log,
cfg.errorlog,
Expand Down

0 comments on commit 7ede5fc

Please sign in to comment.