Reputation: 540
How do I use python logging to log my application code (not access logs) in a multiprocessing gunicorn (and Flask) application?
Do I need centralized logging solution or I could somehow use a file? Is it safe to just point each process to the same file?
Upvotes: 6
Views: 1732
Reputation: 2313
You can use multiprocessing logger:
https://docs.python.org/2/library/multiprocessing.html#logging
Or if you want you can write the logs to a different file in each process by concating the pid to the file name
Upvotes: 3