[Zope-dev] Syslog logger broken?
Paul Winkler
pw_lists at slinkp.com
Thu Aug 5 01:30:16 EDT 2004
I could really use some help with this one.
Does anybody have:
A) an /etc/syslog.conf that definitely works
for logging messages from python's syslog logger?
B) a simple python script that exercises A?
I decided to check whether something was wrong with my syslog
configuration; i now suspect there may be, because
I have been unable to get anything into syslog via python at all.
Here is my non-working test script, derived from the example
in the python standard lib docs at
http://docs.python.org/lib/node301.html :
import logging
logger = logging.getLogger('myapp')
hdlr = logging.handlers.SysLogHandler()
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)
logger.setLevel(logging.WARNING)
logger.error('We have a problem')
logger.info('While this is just chatty')
And here is my attempt at logging everything to a new syslog file,
this is in /etc/syslog.conf:
# XXX
*.* -/var/log/pw_testing.log
On Tue, Aug 03, 2004 at 12:07:33AM -0400, Paul Winkler wrote:
> On Sun, Aug 01, 2004 at 06:20:19AM +0200, Andreas Jung wrote:
> >
> >
> > --On Samstag, 31. Juli 2004 23:37 Uhr -0400 Paul Winkler
> > <pw_lists at slinkp.com> wrote:
> >
> > >Has anybody had success with the syslog logger in Zope 2.7.0 or later?
> > >AFAICT the example in zope.conf.in is borken.
> > >See http://collector.zope.org/Zope/1425
> > >
> > >Andreas assigned it to me, but I really have no clue
> > >how to fix it.
> > >
> > >
> >
> > hm...according to your report only the entries in the example are
> > broken...maybe I have to
> > re-read again..
>
> Yes, please do :-)
> >From the bug report:
>
> """
> The following is what I guess to be correct based on
> zLOG/component.xml, and it raises no errors, but I don't see any
> output either (maybe it's a problem with my /etc/syslog.conf):
>
> <logger trace>
> level all
> <syslog>
> address localhost:514
> </syslog>
> </logger>
> """
>
> --
>
> Paul Winkler
> http://www.slinkp.com
> _______________________________________________
> Zope-Dev maillist - Zope-Dev at zope.org
> http://mail.zope.org/mailman/listinfo/zope-dev
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope )
--
Paul Winkler
http://www.slinkp.com
More information about the Zope-Dev
mailing list