Message167865
import logging
import logging.handlers
import yaml
logger = logging.getLogger() # root logger
# Option 1 - OK
##handler = logging.handlers.RotatingFileHandler(filename = "test.log", maxBytes = 262144, backupCount = 3)
# Option 2 - RotatingFileHandler fails when created through yaml
handler = yaml.load("""
!!python/object/new:logging.handlers.RotatingFileHandler
kwds:
filename: test.log
maxBytes: 262144
backupCount: 3
""")
# Option 3 - FileHandler also fails when created through yaml
##handler = yaml.load("""
##!!python/object/new:logging.FileHandler
## kwds:
## filename: test.log
##""")
logger.addHandler(handler)
logger.warning("test handler") |
|
Date |
User |
Action |
Args |
2012-08-10 10:50:32 | jordipf | set | recipients:
+ jordipf |
2012-08-10 10:50:32 | jordipf | set | messageid: <1344595832.03.0.687864705467.issue15616@psf.upfronthosting.co.za> |
2012-08-10 10:50:31 | jordipf | link | issue15616 messages |
2012-08-10 10:50:31 | jordipf | create | |
|