Skip to content Skip to sidebar Skip to footer

Python Logging With Supervisor

I'm currently using supervisor to monit and daemonize some python scripts easily. However, it seems that supervisor won't log properly. The scripts I'm executing is as simple as t

Solution 1:

Thanks to Pedro Rodrigues, I've found. For anyone struggling like me, well just know that you just create a fileHandler like this :

fh = logging.FileHandler('/var/log/supervisor/your_program_name.log') 

And add to your program conf file :

stdout_logfile=/var/log/supervisor/%(program_name)s.log 

The scripts will write in the log, then read by supervisor, visible on the web interface. One issue it might create is a permission denied if you try to start your script without supervisor.

Post a Comment for "Python Logging With Supervisor"