-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogging.conf
More file actions
46 lines (37 loc) · 1.05 KB
/
Copy pathlogging.conf
File metadata and controls
46 lines (37 loc) · 1.05 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
[loggers]
#Configure logger information. Must include a logger named root,other:logging.getLogger("fileAndConsole")
keys=root,file,fileAndConsole
[handlers]
#Define declaration handlers information.
keys=fileHandler,consoleHandler
[formatters]
#Set log format
keys=simpleFormatter
[logger_root]
level=DEBUG
handlers=consoleHandler
#qualname:name in the logger hierarchy,logging.getLogger("fileAndConsole")
[logger_file]
level=DEBUG
handlers=fileHandler
qualname=file
propagate=1
[logger_fileAndConsole] #Log output to console and file
level=DEBUG
handlers=fileHandler,consoleHandler
qualname=fileAndConsole
propagate=0
[handler_consoleHandler] #Log output to console
class=StreamHandler
args=(sys.stdout,)
level=DEBUG
formatter=simpleFormatter
[handler_fileHandler] #Log output to file
class=logging.handlers.RotatingFileHandler
args=('./log/test.log', 'a', 100*1024*1024, 10)
level=DEBUG
formatter=simpleFormatter
encoding=utf-8
[formatter_simpleFormatter]
format=%(asctime)s - %(module)s - %(thread)d - %(levelname)s : %(message)s
datefmt=%Y-%m-%d %H:%M:%S