We are using the attached patch to /usr/lib/mailman/Mailman/Logger/Syslog.py to
have mailman 2.1.9-2 log to syslog, which seems to work pretty nice.

Regards,
Michael

--- Syslog.py.orig      2006-10-24 10:32:26.000000000 +0200
+++ Syslog.py   2006-10-24 10:38:41.000000000 +0200
@@ -21,6 +21,10 @@
 """
 
 import quopri
+import logging
+import logging.handlers
+import sys
+import os
 
 from Mailman.Logging.StampedLogger import StampedLogger
 
@@ -35,6 +39,11 @@
 class _Syslog:
     def __init__(self):
         self._logfiles = {}
+        self.log=logging.getLogger()
+        self.hdlr = logging.StreamHandler(os.popen("/usr/bin/logger -p 
mail.info -t Mailman","w"))
+        self.hdlr.setFormatter(logging.Formatter("%(message)s"))
+        self.log.addHandler(self.hdlr) 
+        self.log.setLevel(logging.INFO)
 
     def __del__(self):
         self.close()
@@ -63,6 +72,8 @@
         except UnicodeError:
             # Python 2.4 may fail to write 8bit (non-ascii) characters
             logf.write(quopri.encodestring(msg) + '\n')
+        msgsyslog = '%s - %s' % (kind, msg)
+        self.log.info(msgsyslog)
 
     # For the ultimate in convenience
     __call__ = write

Attachment: pgpBfh71DmQvp.pgp
Description: PGP signature

Reply via email to