Random ...
 
December 2017
S M T W T F S
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Tags ...
Links



python+zope++:: Logging Zope: more than one way to do it
Posted at 19.Sep,2005 21:20  Comments 0 / Trackbacks 0 / Like this post!
Technorati tag(s):

All this while, I've been using logfile to log zope events. You know what? There's more than one way to do it.

We can send it to syslog, or win32-event, or email it or send it to a url (and do stuff with it). I haven't tested win32-event and http logging, but had successfully log to a syslog and emailing events to some address.

Open your zope.conf. Look for logger directive. There are three sections to _logger_; access, events and trace. Sending access log to email or syslog is not practical, methinks. Sending trace and event, highly probable, if the log level is not verbose.

Use case: best used in a zeo environment where we can collate all logs from event, access and trace.

Here's the config to send to syslog and email, with win32-event and http-logger commented out, but should work.:

  <eventlog>
  level info
  <logfile>
    path $INSTANCE/log/event.log
    level info
  </logfile>
  <syslog>
    #facility user
    #address localhost:514
  </syslog>
  #<win32-eventlog>
    #appname Zope
  #</win32-eventlog>
  #<http-logger>
    #url http://localhost/
    #method get
  #</http-logger>
  #<email-notifier>
  #  from server@here.com
  #  to kdie@localhost
  #  subject "anything goes here"
  #  smtp-server 127.0.0.1
  #</email-notifier>
  </eventlog>

For syslog to work, you need to make syslog receive logs from other hosts. syslog -r ought to work.

Email-notifier should not need any explanation.

The logger handlers can be found at $ZOPE_HOME/lib/python/ZConfig/components/logger/handlers.xml

Hope this is of value to others.


Bookmark and Share

Is this entry helpful? Comments/Donate/Click some google ads.  
Trackback is http://myzope.kedai.com.my/blogs/kedai/44/tbping 

Comments
Post a comment