sematic
sematic copied to clipboard
Refactor server logging to use a SocketHandler rather than a file handler directly
From python logging cookbook:
When deploying Web applications using Gunicorn or uWSGI (or similar), multiple worker processes are created to handle client requests. In such environments, avoid creating file-based handlers directly in your web application. Instead, use a SocketHandler to log from the web application to a listener in a separate process. This can be set up using a process management tool such as Supervisor - see Running a logging socket listener in production for more details.
But we currently use a rotating file handler. We should refactor to log to a socket, which then uses a rotating file handler.