Update confserver.py
Handle logging of FileHandler response/octet-stream.
This commit is contained in:
parent
75aa74f39c
commit
18adff2178
1 changed files with 32 additions and 15 deletions
|
|
@ -252,6 +252,7 @@ class ConfServer:
|
|||
postbody = None
|
||||
|
||||
response = await handler(request)
|
||||
if not "application/octet-stream" in response.content_type:
|
||||
logall = {
|
||||
"request": {
|
||||
"route_name": f"{request.match_info.route.name}",
|
||||
|
|
@ -268,6 +269,22 @@ class ConfServer:
|
|||
"status": f"{response.status}",
|
||||
}
|
||||
}
|
||||
else:
|
||||
logall = {
|
||||
"request": {
|
||||
"route_name": f"{request.match_info.route.name}",
|
||||
"method": f"{request.method}",
|
||||
"path": f"{request.path}",
|
||||
"query_string": f"{request.query_string}",
|
||||
"raw_path": f"{request.raw_path}",
|
||||
"raw_headers": f'{",".join(map("{}".format, request.raw_headers))}',
|
||||
"body": f"{postbody}",
|
||||
},
|
||||
|
||||
"response": {
|
||||
"status": f"{response.status}",
|
||||
}
|
||||
}
|
||||
|
||||
confserverlog.debug(json.dumps(logall))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue