mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
add possibility to add the request PID to the access logs.
This commit is contained in:
parent
c7a0af5d3a
commit
125d9f1551
@ -678,7 +678,7 @@ class AccessLogFormat(Setting):
|
|||||||
cli = ["--access-logformat"]
|
cli = ["--access-logformat"]
|
||||||
meta = "STRING"
|
meta = "STRING"
|
||||||
validator = validate_string
|
validator = validate_string
|
||||||
default = '%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"'
|
default = "%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"'
|
||||||
desc = """\
|
desc = """\
|
||||||
The Access log format .
|
The Access log format .
|
||||||
|
|
||||||
@ -697,7 +697,8 @@ class AccessLogFormat(Setting):
|
|||||||
f: referer
|
f: referer
|
||||||
a: user agent
|
a: user agent
|
||||||
T: request time in seconds
|
T: request time in seconds
|
||||||
D: request time in microseconds
|
D: request time in microseconds,
|
||||||
|
p: process ID
|
||||||
|
|
||||||
You can also pass any WSGI request header as a parameter.
|
You can also pass any WSGI request header as a parameter.
|
||||||
(ex '%(HTTP_HOST)s').
|
(ex '%(HTTP_HOST)s').
|
||||||
|
|||||||
@ -150,7 +150,8 @@ class Logger(object):
|
|||||||
'f': environ.get('HTTP_REFERER', '-'),
|
'f': environ.get('HTTP_REFERER', '-'),
|
||||||
'a': environ.get('HTTP_USER_AGENT', '-'),
|
'a': environ.get('HTTP_USER_AGENT', '-'),
|
||||||
'T': str(request_time.seconds),
|
'T': str(request_time.seconds),
|
||||||
'D': str(request_time.microseconds)
|
'D': str(request_time.microseconds),
|
||||||
|
'p': "<%s>" % os.getpid()
|
||||||
}
|
}
|
||||||
|
|
||||||
# add WSGI request headers
|
# add WSGI request headers
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user