-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdict_LoggingSetup.py
43 lines (38 loc) · 1018 Bytes
/
dict_LoggingSetup.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
"""
Logging Configuration File
Levels
- CRITICAL
- ERROR
- WARNING
- INFO
- DEBUG
"""
import logging
log_cfg = dict(
version = 1,
formatters = {
'full': {'format':
'%(asctime)s - %(levelname)-8s - %(message)s',
},
'brief': {'format':
'%(asctime)s - %(message)s',
'datefmt': '%d-%m-%Y %H:%M:%S'}
},
handlers = {
'screen': {'class': 'logging.StreamHandler',
'formatter': 'brief',
'level': logging.ERROR,
'stream': 'ext://sys.stdout'},
'file': {'class': 'logging.handlers.RotatingFileHandler',
'formatter': 'full',
'level': logging.DEBUG,
'filename': 'CognIoT.log',
'maxBytes': 1638400,
'backupCount' : 5,
'mode': 'w'},
},
root = {
'handlers': ['screen', 'file'],
'level': logging.DEBUG,
},
)