Not logging correct IP yet
All checks were successful
Build containers when image tags change / build-if-image-changed (., web, containers, main container, git.baumann.gr/adebaumann/labhelper) (push) Successful in 28s
Build containers when image tags change / build-if-image-changed (data-loader, loader, initContainers, init-container, git.baumann.gr/adebaumann/labhelper-data-loader) (push) Successful in 7s
All checks were successful
Build containers when image tags change / build-if-image-changed (., web, containers, main container, git.baumann.gr/adebaumann/labhelper) (push) Successful in 28s
Build containers when image tags change / build-if-image-changed (data-loader, loader, initContainers, init-container, git.baumann.gr/adebaumann/labhelper-data-loader) (push) Successful in 7s
This commit is contained in:
@@ -19,4 +19,4 @@ data:
|
||||
LOGOUT_REDIRECT_URL: "login"
|
||||
TRUSTED_PROXIES: "192.168.17.44,192.168.17.53"
|
||||
GUNICORN_OPTS: "--access-logfile -"
|
||||
IMAGE_TAG: "0.072"
|
||||
IMAGE_TAG: "0.073"
|
||||
|
||||
@@ -27,7 +27,7 @@ spec:
|
||||
mountPath: /data
|
||||
containers:
|
||||
- name: web
|
||||
image: git.baumann.gr/adebaumann/labhelper:0.072
|
||||
image: git.baumann.gr/adebaumann/labhelper:0.073
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
|
||||
@@ -24,6 +24,14 @@ class CustomLogger(Logger):
|
||||
def atoms(self, resp, req, environ, request_time):
|
||||
atoms = super().atoms(resp, req, environ, request_time)
|
||||
atoms["{client-ip}e"] = self._get_client_ip(environ)
|
||||
headers = {
|
||||
k[5:].replace("_", "-").lower(): v
|
||||
for k, v in environ.items()
|
||||
if k.startswith("HTTP_")
|
||||
}
|
||||
atoms["{all-headers}e"] = " | ".join(
|
||||
f"{k}: {v}" for k, v in sorted(headers.items())
|
||||
)
|
||||
return atoms
|
||||
|
||||
@staticmethod
|
||||
@@ -42,4 +50,4 @@ class CustomLogger(Logger):
|
||||
|
||||
|
||||
logger_class = CustomLogger
|
||||
access_log_format = '%({client-ip}e)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s" xff:"%({x-forwarded-for}i)s" remote:%(h)s'
|
||||
access_log_format = '%({client-ip}e)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s" headers:[%({all-headers}e)s]'
|
||||
|
||||
Reference in New Issue
Block a user