[Zope] Zope 2.7 - alternate logging
Chris McDonough
chrism at plope.com
Thu Nov 20 06:21:32 EST 2003
On Wed, 2003-11-19 at 18:18, Chris Beaven wrote:
> Hi there,
>
> I've been looking at Zope 2.7b2 and investigating what I'll need to do
> to reimpliment my virtual host file logger since the z2.py file has gone
> bye-byes.
> It's a slow process trying to figure out where the logger section in
> zope.conf is processed...
>
> To start with, how does one even use the zope.conf file to specify they
> would wish to use the rotating file logger? After I figure out this I
> can at least test my existing code in 2.7
You can't, there is no self-rotating file logger defined in Zope 2.7.
Instead, if you're using Linux you can use a normal log file handler and
set up a 'logrotate' script to call in to Zope with a 'kill -HUP `cat
/path/to/zope/var/Z2.pid`' in the 'postrotate' section, which will
instruct Zope to close and reopen its logfile(s). This is actually
broken in 2.7b2 but is fixed in 2.7b3.
If you're using Windows, you will need to come up with another kind of
(rotating) log handler and plug it in to the ZConfig machinery. This is
a bit more complicated, not something I can roll off the top of my head.
> Has anyone had a look at this before and would be willing to give me
> some pointers for what I should be looking to change to add a new
> handler? Is there an exstensible method for adding handlers or will I
> have to add it directly to /lib/python/logging/handlers.py?
You'll definitely not need to add it there... the log handlers used by
Zope 2.7 are defined within Zope's lib/python/zLOG/LogHandlers.py. You
might be able to get clues from there.
If you want to add a self-rotating log file handler to Zope, you may
find this presentation about ZConfig helpful:
http://www.zope.org/Members/mcdonc/Presentations/ZConfigSlides/zconfig-slides-for-the-web.html
> Thanks in advance for any help ;)
> Chris Beaven
>
>
> _______________________________________________
> Zope maillist - Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )
More information about the Zope
mailing list