Skip to content Skip to sidebar Skip to footer

How To Do Logging With Multiple Django Wsgi Processes + Celery On The Same Webserver

I've got a mod_wsgi server setup with 5 processes and a celery worker queue (2 of them) all on the same VM. I'm running into problems where the loggers are stepping on each other

Solution 1:

As mentioned in the docs, you could use a separate server process which listens on a socket and logs to different destinations, and has whatever logging configuration you want (in terms of files, console and so on). The other processes just configure a SocketHandler to send their events to the server process. This is generally better than separate log files with pids in their filenames.

The logging docs contain an example socket server implementation which you can adapt to your needs.

Post a Comment for "How To Do Logging With Multiple Django Wsgi Processes + Celery On The Same Webserver"