This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jordipf
Recipients jordipf
Date 2012-08-10.10:50:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1344595832.03.0.687864705467.issue15616@psf.upfronthosting.co.za>
In-reply-to
Content
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")
History
Date User Action Args
2012-08-10 10:50:32jordipfsetrecipients: + jordipf
2012-08-10 10:50:32jordipfsetmessageid: <1344595832.03.0.687864705467.issue15616@psf.upfronthosting.co.za>
2012-08-10 10:50:31jordipflinkissue15616 messages
2012-08-10 10:50:31jordipfcreate