Include process ID in the watcher logs
authorIustin Pop <iustin@google.com>
Fri, 11 Jul 2008 13:09:11 +0000 (13:09 +0000)
committerIustin Pop <iustin@google.com>
Fri, 11 Jul 2008 13:09:11 +0000 (13:09 +0000)
Since the watcher is launched by cron, and we can have the situation of
two processes running at the same time (the lock will prevent problems),
we need to have the pid in the log so that it's clear which messages
come from which program.

Reviewed-by: imsnah

daemons/ganeti-watcher

index 84c6b87..2fc274d 100755 (executable)
@@ -447,7 +447,8 @@ def SetupLogging(debug):
   """Configures the logging module.
 
   """
-  formatter = logging.Formatter("%(asctime)s: %(message)s")
+  formatter = logging.Formatter("%(asctime)s %(module)s[%(process)d]:"
+                                " %(message)s")
 
   logfile_handler = logging.FileHandler(constants.LOG_WATCHER)
   logfile_handler.setFormatter(formatter)