mirror of
https://github.com/fastapi-practices/fastapi_best_architecture.git
synced 2026-03-13 09:31:31 +08:00
Fix the IP address in the request log (#959)
This commit is contained in:
@@ -86,7 +86,7 @@ class OperaLogMiddleware(BaseHTTPMiddleware):
|
||||
log.debug(f'接口摘要:[{summary}]')
|
||||
log.debug(f'请求地址:[{ctx.ip}]')
|
||||
log.debug(f'请求参数:{args}')
|
||||
log.info(f'{request.client.host: <15} | {request.method: <8} | {code!s: <6} | {path} | {elapsed:.3f}ms')
|
||||
log.info(f'{ctx.ip: <15} | {request.method: <8} | {code!s: <6} | {path} | {elapsed:.3f}ms')
|
||||
if request.method != 'OPTIONS':
|
||||
log.debug('<-- 请求结束')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user