logging.conf
1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
[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