forked from Hydrosys4/Master
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloggerconfig.py
71 lines (70 loc) · 2.07 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
LOG_SETTINGS = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'detailed': {
'format': '%(asctime)s | %(levelname)s | %(filename)s | %(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
},
'actuator':{
'class': 'logging.handlers.RotatingFileHandler',
'level': 'DEBUG',
'formatter': 'detailed',
'filename': 'logfiles/actuator.log',
'backupCount': 3,
'encoding': 'utf8',
'maxBytes': 1048576,
'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'
},
'actuator': {
'handlers':['actuator'],
'propagate': False,
'level':'DEBUG'
},
'exception': {
'handlers': ['exception_file_handler'],
'level': 'ERROR',
'propagate': False
}
}
}