By kshnkvn
I have a flask application running in gunicorn in the app platform.
Run command:
gunicorn --config gconfig.py --worker-tmp-dir /dev/shm --log-level error wsgi:app
bind = '0.0.0.0:8080'
workers = 2
worker_class = 'gevent'
worker_connections = 1000
flask init:
if logging.getLogger('gunicorn.error').handlers:
app.logger.handlers.clear()
app.logger.handlers.extend(
logging.getLogger('gunicorn.error').handlers)
app.logger.setLevel(logging.INFO)
But the logs contain http requests:
app-name | 2021-02-18 19:28:13 10.244.8.44 - - [18/Feb/2021:17:28:13 +0000] "POST /route HTTP/1.1" 200 322 "-" "Apache-HttpClient/4.5.7 (Java/1.8.0_212)"
I want the logs to contain only errors and the messages that I send myself:
current_app.logger.info('some log message')
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
The log messages you’ve referenced aren’t generated by App Platform. I suspect they’re being emitted by either gunicorn or flask. In gunicorn I believe you can disable the access log by setting accesslog = False. https://docs.gunicorn.org/en/stable/settings.html#settings
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.