From 714954ca8cde45ee1a1302458985c9c406535ec3 Mon Sep 17 00:00:00 2001
From: Bernhard Mallinger <bernhard.mallinger@eox.at>
Date: Thu, 24 Feb 2022 16:19:26 +0100
Subject: [PATCH] Define a json format for the gunicorn access log

---
 gunicorn.conf.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gunicorn.conf.py b/gunicorn.conf.py
index 1dcc784..0228b78 100644
--- a/gunicorn.conf.py
+++ b/gunicorn.conf.py
@@ -11,6 +11,10 @@ worker_class = 'sync'
 
 # logging
 accesslog = '-'
+access_log_format = '{"remote_address":"%(h)s",' \
+    '"response_code":"%(s)s","request_method":"%(m)s",' \
+    '"request_path":"%(U)s","request_querystring":"%(q)s",' \
+    '"request_timetaken":"%(D)s","response_length":"%(B)s"}'
 errorlog = '-'
 loglevel = 'warning'
 disable_redirect_access_to_syslog = True
-- 
GitLab