logging.conf 1.16 KB
[loggers]
keys = root, simpleLog

[handlers]
keys = consoleHandler, fileHandler, timedRotatingHandler, rotatingFileHandler

[formatters]
keys = simpleFormatter

[logger_root]
level = DEBUG
handlers = consoleHandler

[logger_simpleLog]
level = DEBUG
handlers = consoleHandler, rotatingFileHandler
qualname = simpleLog
propagate = 0

[handler_consoleHandler]
class = StreamHandler
args = (sys.stdout,)
level = INFO
formatter = simpleFormatter

[handler_fileHandler]
class = FileHandler
args = (LogFilePath,)
level = WARNING
formatter = simpleFormatter

[handler_timedRotatingHandler]
class = handlers.TimedRotatingFileHandler
#('testing.log', when='M', interval=1, backupCount=2, encoding='utf-8')
args = (LogFilePath, 'midnight', 1, 3, 'utf-8',)
level = WARNING
formatter = simpleFormatter

[handler_rotatingFileHandler]
; logging.handlers.RotatingFileHandler('all.log', maxBytes=1024, backupCount=2, encoding='utf-8')
class = logging.handlers.RotatingFileHandler
args = (LogFilePath, 'a', 10*1024*1024, 3, 'utf-8',)
level = INFO
formatter = simpleFormatter

[formatter_simpleFormatter]
format = [%(asctime)s] [%(levelname)s] [%(funcName)s] [%(message)s]
; datefmt = %Y-%m-%d %H:%M:%S