-
Notifications
You must be signed in to change notification settings - Fork 0
/
logging-cfg-local.yaml
89 lines (84 loc) · 2.29 KB
/
logging-cfg-local.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
version: 1
disable_existing_loggers: False # this allow to get logger at module level
root:
handlers:
- console
level: DEBUG
propagate: True
loggers:
# Remove all handlers for werkzeug log entries - prevents duplicated logging
# Un-comment these lines if you use Flask
# werkzeug:
# handlers: []
gunicorn.error:
level: DEBUG
handlers:
- console
gunicorn.access:
level: DEBUG
handlers:
- console
filters:
application:
(): logging_utilities.filters.ConstAttribute
application: your-application-name # set the correct application name
isotime:
(): logging_utilities.filters.TimeAttribute
isotime: False
utc_isotime: True
# Un-comment these lines if you use flask
# flask:
# (): logging_utilities.filters.flask_attribute.FlaskRequestAttribute
# attributes:
# - url
# - method
# - headers
# - remote_addr
# - json
formatters:
standard:
format: "[%(asctime)s] %(levelname)-8s - %(name)-26s : %(message)s"
# Un-comment these lines if you use flask
# verbose-flask:
# format: "[%(asctime)s] %(levelname)-8s - %(name)-26s : %(message)s : 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:
- application
- utc_isotime
# Un-comment these lines if you use flask
# - flask_request_url
# - flask_request_method
# - flask_request_headers
# - flask_request_json
# - flask_request_remote_addr
remove_empty: True
fmt:
time: utc_isotime
level: levelname
app: application
logger: name
module: module
function: funcName
process: process
thread: thread
# Un-comment these lines if you use flask
# request:
# url: flask_request_url
# 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:
- application
- isotime
# Un-comment this lines if you use flask
#- flask