Conversation
|
@rolodato rather than adding a custom middleware, I'd rather rely on uvicorn's access logs. It looks like there's some customisation needed in order to log out the timestamp, but I think that's better than a middleware. Is there a reason that you went with a middleware here instead? |
|
The access log prints one log entry per completed request, for example: The difference with the middleware is that, if a request is never responded, then the access log will not print anything. The middleware would print a log for the request, but not for the response. You can simulate this by adding an infinite loop to any Edge Proxy endpoint. I haven't found a way to get uvicorn to log requests and responses separately. We'll wait to hear back from the customer that requested this enhancement to see if the access logs would be enough to troubleshoot their issue. |
|
Closing this PR until we confirm it's necessary. |
Example log entries running with
LOGGING='{"log_level":"DEBUG","log_format":"json"}':