-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathlog_config2.json
83 lines (83 loc) · 2.39 KB
/
log_config2.json
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
72
73
74
75
76
77
78
79
80
81
82
83
{
"version": 1,
"disable_existing_loggers": true,
"formatters": {
"brief": {
"class": "logging.Formatter",
"datefmt": "%I:%M:%S",
"format": "%(levelname)-8s; %(name)-15s; %(message)s"
},
"standard": {
"class": "logging.Formatter",
"datefmt": "%I:%M:%S",
"format": "%(levelname)-8s; %(asctime)s; %(name)-15s; %(funcName)s;%(lineno)d: %(message)s"
},
"multi-process": {
"class": "logging.Formatter",
"datefmt": "%I:%M:%S",
"format": "%(levelname)-8s; [%(process)d]; %(name)-15s; %(module)s:%(funcName)s;%(lineno)d: %(message)s"
},
"multi-thread": {
"class": "logging.Formatter",
"datefmt": "%I:%M:%S",
"format": "%(levelname)-8s; %(threadName)s; %(name)-15s; %(module)s:%(funcName)s;%(lineno)d: %(message)s"
},
"verbose": {
"class": "logging.Formatter",
"datefmt": "%I:%M:%S",
"format": "%(levelname)-8s; [%(process)d]; %(threadName)s; %(name)-15s; %(module)s:%(funcName)s;%(lineno)d: %(message)s"
},
"multiline": {
"class": "logging.Formatter",
"format": "Level: %(levelname)s\nTime: %(asctime)s\nProcess: %(process)d\nThread: %(threadName)s\nLogger: %(name)s\nPath: %(module)s:%(lineno)d\nFunction :%(funcName)s\nMessage: %(message)s\n"
}
},
"handlers": {
"console":{
"level": "DEBUG",
"class": "logging.StreamHandler",
"formatter": "verbose",
"stream" : "ext://sys.stdout"
},
"file_handler": {
"level": "INFO",
"class": "logging.handlers.WatchedFileHandler",
"formatter": "verbose",
"filename": "/tmp/file_handler.log",
"mode": "a",
"encoding": "utf-8"
},
"smtp": {
"level": "ERROR",
"class": "logging.handlers.SMTPHandler",
"formatter": "multiline",
"mailhost": ["127.0.0.1", 60025],
"fromaddr": "[email protected]",
"toaddrs": ["[email protected]"],
"subject": "Something went wrong"
}
},
"loggers": {
"mypkg": {
"handlers": ["console"],
"level": "DEBUG",
"propagate": false
},
"elasticsearch": {
"handlers": ["console"],
"level": "WARNING"
},
"requests": {
"handlers": ["console"],
"level": "WARNING"
},
"sqlalchemy": {
"handlers": ["console"],
"level": "WARNING"
}
},
"root": {
"handlers": ["console", "file_handler", "smtp"],
"level": "DEBUG"
}
}