I am trying to add watches using python pyinotify and daemonize the notifier.
notifier = pyinotify.Notifier(wm, handler)
notifier.loop(daemonize=True, pid_file='/tmp/pyinotifier.pid',
stdout='/tmp/out.log', stderr='/tmp/error.log')
However I could find, the log files are overwritten not getting appended.
Is there a way to append stdout and stderr?
I am on Linux OS.
thanks
Looking at the source, it appears as though the logs are opened in
O_WRONLYmode, which is why you see them being overwritten each time you invoke the loop:There is a pull request open to open the logs in
O_APPENDmode, but it's nearly 8 months old and the author has not responded.It doesn't look like there's a reasonable way to append the logs at this time.