-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathloggerconfig.py
55 lines (55 loc) · 1.66 KB
/
loggerconfig.py
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
49
50
51
52
53
54
55
LOG_SETTINGS = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'detailed': {
'format': '%(asctime)s | %(process)d | %(levelname)s | %(filename)s | %(lineno)d | %(funcName)s | %(message)s',
'datefmt': '%Y-%m-%d %H:%M:%S'
},
'simple': {
'format': '%(asctime)-2s %(name)28s - %(levelname)-10s %(message)s',
'datefmt': '%H:%M:%S'
},
},
'handlers': {
'console':{
'level':'DEBUG',
'class':'logging.StreamHandler',
'formatter': 'simple'
},
'access_file_handler':{
'class': 'logging.handlers.TimedRotatingFileHandler',
'level': 'DEBUG',
'formatter': 'simple',
'filename': 'logfiles/hydrosystem.log',
'backupCount': 3,
'encoding': 'utf8',
'when': 'midnight',
'interval': 1,
'delay': True
},
'exception_file_handler':{
'class': 'logging.handlers.TimedRotatingFileHandler',
'level': 'ERROR',
'formatter': 'detailed',
'filename': 'logfiles/ex_hydrosystem.log',
'backupCount': 3,
'encoding': 'utf8',
'when': 'midnight',
'interval': 1,
'delay': True
}
},
'loggers': {
'hydrosys4': {
'handlers':['access_file_handler'],
'propagate': False,
'level':'DEBUG'
},
'exception': {
'handlers': ['exception_file_handler'],
'level': 'ERROR',
'propagate': False
}
}
}