NTEventLogHandler not logging `info'?

Jaime Wyant programmer.py at gmail.com
Thu Sep 22 11:58:55 EDT 2005


I must be missing something. This is what I read from the documentation:

When a logger is created, the level is set to NOTSET (which causes all
messages to be processed in the root logger, or delegation to the
parent in non-root loggers).

:/

Thanks!
jw

On 22 Sep 2005 08:21:48 -0700, Vinay Sajip <vinay_sajip at yahoo.co.uk> wrote:
> Jaime Wyant wrote:
> > This code doesn't seem to do what I think it should do:
> >
> > # python 2.3.2
> > # not sure of my win32 extensions version
> >
> > import logging
> > from logging.handlers import NTEventLogHandler
> > logger = logging.getLogger("testlogger")
> > handler = NTEventLogHandler("testlogger")
> > logger.addHandler(handler)
> > logger.info("This is a test")
> >
> >
> > I expected to see an `information' message in my `Application' event
> > log.  Any ideas?
> >
>
> By default, the logger's level is WARNING, because you haven't
> explicitly set a level and the level inherited from the parent logger
> is WARNING (this is the default value for the root logger level). So if
> you add a line before the logger.info() call:
>
> logger.setLevel(logging.INFO) # or you can use logging.DEBUG
>
> Then you should see an entry appear in the NT Event log.
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list