I am creating a daemon process which monitors loads on database. The process is created using the reference of code at http://code.activestate.com/recipes/278731-creating-a-daemon-the-python-way/
What I am trying to do is:
- Call the createDaemon() method defined in the function on above link.
- Call the function monitor_load() after calling above mentioned function. This function is defined in the same script.
Inside monitor_load(), I call python logging module to log all information in a log file.
I understand that while creating daemon, the code is redirecting all STDOUT, STDIN, STDERR to /dev/null, but I do not want that to happen. I want all logging to happen properly from inside the daemon process.
Any idea how I can accomplish that?
Thanks.