Vinny wrote:

Where can I find the configuration setting for the logging level used in the transcript.log file?

I have tried looking in etc/zope.conf, etc/zdaemon.conf
and came up empty handed.  I can see ERROR levels easily

The transcript log is created by zdaemon and captures
all output from the application being run, in this case,
Zope.  It has nothing to do with the Python logging system
and has no concept of log level.

> This works and shows up in transcript.log:
> import logging
> logging.basicConfig(level=logging.DEBUG,
>                     format='%(asctime)s %(levelname)-8s %(message)s',
>                     datefmt='%a, %d %b %Y %H:%M:%S',
>                     filemode='a')
> logging.error('Pack my box with %d dozen %s', 5, 'liquor jugs')
> But this does not show up in transcript.log:
> logging.debug('Pack my box with %d dozen %s', 5, 'liquor jugs')
> Both messages end up in my local log file.  I think I understand
> that the logging function is using mine and a logger registered
> with zope.  Where do I find out about the zope logger?

That's a good question.  Logging is controlled through ZConfig and
I'm not aware that our ZConfig setup is documented, except through
comments in sample zope.conf files.  I'm not a big fan of how we
currently do configuration.

I think you want to change the logging level by adding a level
option to the event log:

  level debug

    path $LOGDIR/z3.log
    formatter zope.exceptions.log.Formatter

    path STDOUT
    formatter zope.exceptions.log.Formatter

In this example, I have set the logging level for the
event logger to debug, so you will see debug messages.
The default logging level is info.

Note that in the example above we are sending output to
2 places, z3.log and standard output.  Because the zdaemon
transcript log captures standard output, it is the standard
output logger that affects the transcript log.  IMO, it is
silly to log to two places. I would just log to standard
output.  (The only problem with this is that older versions
os zdaemon don't support log rotation. I have fixed this
in the latest version of zdaemon.)


Jim Fulton           mailto:[EMAIL PROTECTED]       Python Powered!
CTO                  (540) 361-1714  
Zope Corporation
Zope3-users mailing list

Reply via email to