-
-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
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
Logging with Gunicorn and use_queues #89
Comments
There's currently an issue where logs in the gunicorn app server process don't get pushed to CW. This resolves that, in order to make way for formatting RBAC logs as JSON. Here are some related issues which presented the solution: kislyuk/watchtower#54 kislyuk/watchtower#89
I am the "next poor soul". Thank you for noting this. |
Possibly related, I ran into an issue today during deployment of a Django application that relies on Gunicorn, using watchtower==0.8.0 caused Gunicorn to crash on launch, downgrading to watchtower==0.7.3 and the problem went away and Gunicorn started normally. |
This just saved my bacon too. For future searchers: Would be good to not have to turn off queues Edit to add: I switched my logging from being configured in gunicorn to being configured in Django and it worked. I had to coax gunicorn into not skipping access logging with this travesty: |
Im running to |
I am unable to reproduce this issue. When I run my wsgi application with gunicorn, I am able to log messages successfully. It's possible that logging messages in certain contexts causes a deadlock, but I would need specific information on how to reproduce that in order to act on it. Setting use_queues to False in production is not recommended, since it will cause performance issues due to the synchronous sending of one CloudWatch API request per log message. |
Got the same issue, any solutions for this? |
Same issue. Using Uvicorn 0.24 and FastAPI 0.105. |
Also seeing this issue with FastAPI 0.115.6 and uvicorn 0.34.0. FastAPI starts, the WatchtowerWarning is thrown, and then it seems the thread dies entirely causing any future logs to not be sent. |
Not sure if this is a bug in a package. I'm just writing this to help the next poor soul who comes along and tries to get this to work.
Maybe it's obvious to others, use_queues has to spawn a thread to manage a queue. Gunicorn spawns threads to handle api requests. The use_queues thread is unable to listen to the Gunicorn threads... I think...
Therefore
use_queues
must be disabled in order to get access logs from gunicorn.The text was updated successfully, but these errors were encountered: