extras are now uppercase

Dieser Commit ist enthalten in:
Sebastian Tobie 2024-03-06 21:11:57 +01:00
Ursprung 008c5b866f
Commit de00f29ea1
1 geänderte Dateien mit 9 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -85,20 +85,20 @@ class Logger(gLogger):
# - if atom doesn't exist replace it by '-' # - if atom doesn't exist replace it by '-'
safe_atoms = self.atoms_wrapper_class(self.atoms(resp, req, environ, request_time)) safe_atoms = self.atoms_wrapper_class(self.atoms(resp, req, environ, request_time))
extra = dict( extra = dict(
method=environ.get("REQUEST_METHOD"), METHOD=environ.get("REQUEST_METHOD"),
path=environ.get("PATH_INFO"), PATH=environ.get("PATH_INFO"),
query=environ.get("QUERY_STRING"), QUERY=environ.get("QUERY_STRING"),
proto=environ.get("SERVER_PROTOCOL"), PROTO=environ.get("SERVER_PROTOCOL"),
time="%d.%06d" % (request_time.seconds, request_time.microseconds), TIME="%d.%06d" % (request_time.seconds, request_time.microseconds),
) )
if environ.get("REMOTE_ADDR", False): if environ.get("REMOTE_ADDR", False):
extra["remote"] = environ.get("REMOTE_ADDR") extra["REMOTE"] = environ.get("REMOTE_ADDR")
if getattr(resp, "sent", False): if getattr(resp, "sent", False):
extra["length"] = getattr(resp, "sent") extra["LENGTH"] = getattr(resp, "sent")
if environ.get("HTTP_REFERER", False): if environ.get("HTTP_REFERER", False):
extra["referer"] = environ.get("HTTP_REFERER") extra["REFERER"] = environ.get("HTTP_REFERER")
if environ.get("HTTP_USER_AGENT", False): if environ.get("HTTP_USER_AGENT", False):
extra["user_agent"] = environ.get("HTTP_USER_AGENT") extra["USER_AGENT"] = environ.get("HTTP_USER_AGENT")
try: try:
self.access_log.info(self.cfg.access_log_format, safe_atoms, extra=extra) self.access_log.info(self.cfg.access_log_format, safe_atoms, extra=extra)