Log request without blocking api response #3505
Unanswered
thomasaarholt
asked this question in
Q&A
Replies: 1 comment
-
@thomasaarholt the trade-off is the logging consistency. If returning the response before the log is committed to the database is acceptable, you can consider store the log in memory and run the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to log requests and responses, to a database in order to track usage and what the response is. My logging function is slow, taking over a second to upload to a database.
Is there a way I can pass the request and response to a function without blocking the response being sent?
Stealing the bentoml readme example and modifying slightly:
How can I make
slow_logging_function
non-blocking?Beta Was this translation helpful? Give feedback.
All reactions