-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogging-cfg-flask-prod.yaml
116 lines (111 loc) · 2.58 KB
/
logging-cfg-flask-prod.yaml
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
105
106
107
108
109
110
111
112
113
114
115
116
version: 1
disable_existing_loggers: False # this allow to get logger at module level
root:
handlers:
- console
level: WARNING
propagate: True
loggers:
# Remove all handlers for werkzeug log entries - prevents duplicated logging
werkzeug:
handlers: []
gunicorn.error:
level: WARNING
handlers:
- console
gunicorn.access:
level: WARNING
handlers:
- console
urllib3:
level: WARNING
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
- query_string
- url
- view_args
const_attributes:
(): logging_utilities.filters.ConstAttribute
service_type: flask
formatters:
json:
(): logging_utilities.formatters.json_formatter.JsonFormatter
add_always_extra: False
filter_attributes:
- utc_isotime
- flask_request_path
- flask_request_method
- flask_request_query_string
- flask_request_headers
- flask_request_form
- flask_request_remote_addr
- flask_request_url
- flask_request_view_args
- service_type
remove_empty: True
ignore_missing: True
fmt:
# ECS fields
message: message
event:
category: web
created: utc_isotime
duration: duration
kind: event
severity: levelno
http:
request:
headers: flask_request_headers.
method: "%(flask_request_method)s"
response:
headers: response.headers.
status_code: response.status_code
log:
level: levelname
logger: name
origin:
file:
name: pathname
line: lineno
function: funcName
url:
original: flask_request_url
process:
pid: process
thread:
id: thread
service:
type: service_type
# Custom fields
ppbgdi:
proxy:
downstream:
url:
scheme: remote.request.proto
domain: remote.request.domain
full: remote.request.url
path: remote.request.path
http:
response:
status_code: remote.response.status_code
headers: remote.response.headers
handlers:
console:
class: logging.StreamHandler
formatter: json
stream: ext://sys.stdout
filters:
- isotime
- flask
- const_attributes