We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am able to log user requests in the access logs, but not able to track response times.
I hope the access logs allows for a pattern that lets user to define pattern in logger to capture response time
Current:
"access": { "()": "uvicorn.logging.AccessFormatter", "datefmt": "%Y-%m-%dT%H:%M:%S%z", "fmt": '%(asctime)s::%(levelprefix)s %(client_addr)s - "%(request_line)s" %(status_code)s', "use_colors": False, },
Future:
"access": { "()": "uvicorn.logging.AccessFormatter", "datefmt": "%Y-%m-%dT%H:%M:%S%z", "fmt": '%(asctime)s::%(levelprefix)s %(client_addr)s - "%(request_line)s" **%(resp_time)s** %(status_code)s', "use_colors": False, },
I was suggested third party tool in the community chat: https://github.com/steinnes/timing-asgi
Seems like an improper solution for this. The response time is not embedded in the access log itself...
Sample log from library git page..
INFO: Started server process [35895] INFO: Waiting for application startup. 2019-03-07 11:38:01 INFO [timing_asgi.middleware:44] ASGI scope of type lifespan is not supported yet INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit) INFO: ('127.0.0.1', 58668) - "GET / HTTP/1.1" 200 myapp.__main__.homepage 0.0006690025329589844 ['http_status:200', 'http_method:GET', 'time:wall'] myapp.__main__.homepage 0.0006950000000000012 ['http_status:200', 'http_method:GET', 'time:cpu'] INFO: ('127.0.0.1', 58684) - "GET /asdf HTTP/1.1" 404 myapp.asdf 0.0005478858947753906 ['http_status:404', 'http_method:GET', 'time:wall'] myapp.asdf 0.0005909999999999804 ['http_status:404', 'http_method:GET', 'time:cpu']
No response
The text was updated successfully, but these errors were encountered:
Duplicated #527
Sorry, something went wrong.
No branches or pull requests
Checklist
Is your feature related to a problem? Please describe.
I am able to log user requests in the access logs, but not able to track response times.
Describe the solution you would like.
I hope the access logs allows for a pattern that lets user to define pattern in logger to capture response time
Current:
Future:
Describe alternatives you considered
I was suggested third party tool in the community chat:
https://github.com/steinnes/timing-asgi
Seems like an improper solution for this. The response time is not embedded in the access log itself...
Sample log from library git page..
Additional context
No response
The text was updated successfully, but these errors were encountered: