[Zope-Checkins]
SVN: Zope/trunk/lib/python/Products/SiteErrorLog/SiteErrorLog.py
death to zLOG
Andreas Jung
andreas at andreas-jung.com
Wed May 12 12:53:44 EDT 2004
Log message for revision 24592:
death to zLOG
-=-
Modified: Zope/trunk/lib/python/Products/SiteErrorLog/SiteErrorLog.py
===================================================================
--- Zope/trunk/lib/python/Products/SiteErrorLog/SiteErrorLog.py 2004-05-12 15:10:32 UTC (rev 24591)
+++ Zope/trunk/lib/python/Products/SiteErrorLog/SiteErrorLog.py 2004-05-12 16:53:43 UTC (rev 24592)
@@ -19,6 +19,7 @@
import os
import sys
import time
+import logging
from random import random
from thread import allocate_lock
from types import StringType, UnicodeType
@@ -29,8 +30,9 @@
from OFS.SimpleItem import SimpleItem
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from zExceptions.ExceptionFormatter import format_exception
-from zLOG import LOG, ERROR
+LOG = logging.getLogger('Zope.SiteErrorLog')
+
# Permission names
use_error_logging = 'Log Site Errors'
log_to_event_log = 'Log to the Event Log'
@@ -194,8 +196,7 @@
finally:
cleanup_lock.release()
except:
- LOG('SiteError', ERROR, 'Error while logging',
- error=sys.exc_info())
+ LOG.error('Error while logging', exc_info=sys.exc_info())
else:
if self.copy_to_zlog:
self._do_copy_to_zlog(now,strtype,str(url),info)
@@ -209,7 +210,7 @@
next_when = max(when, now-_rate_restrict_burst*_rate_restrict_period)
next_when += _rate_restrict_period
_rate_restrict_pool[strtype] = next_when
- LOG('SiteError', ERROR, str(url), error=info)
+ LOG.error(str(url), exc_info=info)
security.declareProtected(use_error_logging, 'getProperties')
def getProperties(self):
More information about the Zope-Checkins
mailing list