From 568d0e295ae952c9a392b7c416becad164b8447d Mon Sep 17 00:00:00 2001 From: Sebastian Tobie Date: Sun, 10 Mar 2024 00:31:52 +0100 Subject: [PATCH] the gunicorn logger has now an hardcoded access log --- .../src/gunicorn_logging_extension/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gunicorn-logging-extension/src/gunicorn_logging_extension/__init__.py b/gunicorn-logging-extension/src/gunicorn_logging_extension/__init__.py index 64dfab5..dce9926 100644 --- a/gunicorn-logging-extension/src/gunicorn_logging_extension/__init__.py +++ b/gunicorn-logging-extension/src/gunicorn_logging_extension/__init__.py @@ -37,6 +37,7 @@ CONFIG_DEFAULTS = { class Logger(gLogger): + access_log_format = "Access(%(s)s) %(r)s" def __init__(self, cfg): self.logfile = None @@ -112,6 +113,6 @@ class Logger(gLogger): extra["USER_AGENT"] = environ.get("HTTP_USER_AGENT") try: - level(self.cfg.access_log_format, safe_atoms, extra=extra) + level(self.access_log_format, safe_atoms, extra=extra) except Exception: self.error(traceback.format_exc())