Changeset 8492 for main/waeup.kofa/trunk/src/waeup/kofa/utils/logger.py
- Timestamp:
- 22 May 2012, 23:30:17 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/utils/logger.py
r7811 r8492 77 77 import logging 78 78 from string import Template 79 from ulif.loghandlers import DatedRotatingFileHandler 79 80 from zope import schema 80 81 from zope.component import queryUtility … … 84 85 from waeup.kofa.utils.helpers import get_current_principal 85 86 86 #: Default logfile size (5 KB )87 #: Default logfile size (5 KB, not relevant for DatedRotatingFileHandlers) 87 88 MAX_BYTES = 5 * 1024 ** 2 88 89 89 #: Default num of backup files ( 5)90 BACKUP_COUNT = 590 #: Default num of backup files (-1 = indefinite) 91 BACKUP_COUNT = -1 91 92 92 93 #: Default logging level (`logging.INFO') … … 212 213 213 214 # Create a rotating file handler logger. 214 handler = logging.handlers.RotatingFileHandler(215 filename, maxBytes=MAX_BYTES, backupCount=BACKUP_COUNT)215 handler = DatedRotatingFileHandler( 216 filename, when='MON', backupCount=BACKUP_COUNT) 216 217 handler.setLevel(LEVEL) 217 218 formatter = logging.Formatter(
Note: See TracChangeset for help on using the changeset viewer.