Skip to content

Commit c3e26b9

Browse files
authored
Merge pull request #15 from marfire/patch-1
Add query strings to the log output
2 parents 62823bd + 6471980 commit c3e26b9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

requestlogger/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,11 @@ def format_NCSA_log(status_code, environ, content_length, **kwargs):
9494
date = dt.now(tz=Local)
9595
month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"][date.month - 1]
9696
val['time'] = date.strftime("%d/{0}/%Y:%H:%M:%S %z".format(month))
97-
val['request'] = "{0} {1} {2}".format(
97+
val['request'] = "{0} {1}{2}{3} {4}".format(
9898
environ.get('REQUEST_METHOD', ''),
9999
environ.get('PATH_INFO', ''),
100+
'?' if environ.get('QUERY_STRING', '') else '',
101+
environ.get('QUERY_STRING', ''),
100102
environ.get('SERVER_PROTOCOL', '')
101103
)
102104
val['status'] = status_code

0 commit comments

Comments
 (0)