[Tutor] More logging probs ...

dave selby dave6502 at googlemail.com
Sat Nov 17 14:07:34 CET 2007


OK so to condense the problem the following works at LOG_INFO default
priority ...

    def log(self, msg, priority):
        syslog.openlog(self.ident , syslog.LOG_PID)
        syslog.syslog('testing message')
        syslog.closelog()

But as soon as I try to set a priority API syslog docs, it fails to log ...

    def log(self, msg, priority):
        syslog.openlog(self.ident , syslog.LOG_PID)
        syslog.syslog((syslog.LOG_ALERT | syslog.LOG_USER), 'testing message')
        syslog.closelog()

PS tried LOG_LOCAL6 etc, same result.

Trying to change the priority in openlog() logs but does not appear to
change the priority since syslog.setlogmask() indicate it is stuck at
LOG_INFO

    def log(self, msg, priority):
        syslog.openlog(self.ident , syslog.LOG_PID, (syslog.LOG_ALERT
| syslog.LOG_LOCAL6))
        syslog.syslog('testing message')
        syslog.closelog()

Still stuck

Dave


More information about the Tutor mailing list