question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Logging with Gunicorn and use_queues

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
jasondarnellcommented, May 22, 2020

I am the “next poor soul”. Thank you for noting this.

0reactions
DilLip-Chowdary-Codescommented, Aug 3, 2022

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Logging, Flask, and Gunicorn... the Manageable Way
The solution is simple but effective: Check to see if our Flask application is being run directly or through Gunicorn, and then set...
Read more >
How to manage logs with Django, Gunicorn and NGINX
Set up Django to log everything to stdout/stderr using the StreamHandler and capture the output using Gunicorn via the capture_output option, ...
Read more >
Settings — Gunicorn 20.1.0 documentation
You can provide your own logger by giving Gunicorn a Python path to a class that quacks like gunicorn.glogging.Logger . logconfig ¶. Command...
Read more >
Logs with Flask and Gunicorn - LinkedIn
We need to make sure logs coming from Flask and Gunicorn are wired together in order for us to have a nice logging...
Read more >
Logging in flask with gunicorn - Stack Overflow
Could someone help me if this the right way to log application logs. logging · flask · gunicorn · Share.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found