fix(server): tolerate malformed request logging
This commit is contained in:
committed by
nesquena-hermes
parent
2e876ea229
commit
618e1a5da8
@@ -232,8 +232,8 @@ class Handler(BaseHTTPRequestHandler):
|
||||
duration_ms = round((time.time() - getattr(self, '_req_t0', time.time())) * 1000, 1)
|
||||
record = _json.dumps({
|
||||
'ts': time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime()),
|
||||
'method': self.command or '-',
|
||||
'path': self.path or '-',
|
||||
'method': getattr(self, 'command', None) or '-',
|
||||
'path': getattr(self, 'path', None) or '-',
|
||||
'status': int(code) if str(code).isdigit() else code,
|
||||
'ms': duration_ms,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user