-
Notifications
You must be signed in to change notification settings - Fork 1
/
logging-cfg-local.yml
104 lines (99 loc) · 2.4 KB
/
logging-cfg-local.yml
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
version: 1
disable_existing_loggers: False # this allow to get logger at module level
root:
handlers:
- console
- file-standard
- file-json
level: DEBUG
propagate: True
# Remove all handlers for werkzeug log entries - prevents duplicated logging
loggers:
werkzeug:
handlers: []
gunicorn.error:
level: DEBUG
handlers:
- console
- file-standard
- file-json
gunicorn.access:
level: DEBUG
handlers:
- console
- file-standard
- file-json
filters:
isotime:
(): logging_utilities.filters.TimeAttribute
isotime: False
utc_isotime: True
flask:
(): logging_utilities.filters.flask_attribute.FlaskRequestAttribute
attributes:
- path
- method
- headers
- remote_addr
- form
formatters:
standard:
(): logging_utilities.formatters.extra_formatter.ExtraFormatter
format: "[%(asctime)s] %(levelname)-8s - %(name)-26s : %(message)s"
verbose:
(): logging_utilities.formatters.extra_formatter.ExtraFormatter
format: "[%(asctime)s] %(levelname)-8s - %(name)-26s : %(message)s"
extra_fmt: " : url=%(request_url)s headers=%(request_headers)s payload=%(request_json)s"
json:
(): logging_utilities.formatters.json_formatter.JsonFormatter
add_always_extra: True
filter_attributes:
- utc_isotime
- flask_request_path
- flask_request_method
- flask_request_headers
- flask_request_json
- flask_request_remote_addr
remove_empty: True
fmt:
time: utc_isotime
level: levelname
logger: name
module: module
function: funcName
process: process
thread: thread
request:
path: flask_request_path
method: flask_request_method
headers: flask_request_headers
data: flask_request_json
remote: flask_request_remote_addr
exc_info: exc_info
message: message
handlers:
console:
class: logging.StreamHandler
formatter: standard
stream: ext://sys.stdout
filters:
- isotime
- flask
file-standard:
level: DEBUG
class: logging.FileHandler
formatter: verbose
filename: ${LOGS_DIR}/server-standard-logs.txt
mode: w
filters:
- isotime
- flask
file-json:
level: DEBUG
class: logging.FileHandler
formatter: json
filename: ${LOGS_DIR}/server-json-logs.json
mode: w
filters:
- isotime
- flask