-
Notifications
You must be signed in to change notification settings - Fork 0
/
log_config.yml
48 lines (48 loc) · 1.36 KB
/
log_config.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
#### This is a sample logging configuration for the API. ####
version: 1
disable_existing_loggers: True
formatters:
default:
(): 'uvicorn.logging.DefaultFormatter'
datefmt: '%b-%d-%Y %I:%M:%S %p'
fmt: '%(asctime)s %(levelprefix)-9s [%(module)s:%(lineno)d] - %(message)s'
use_colors: False
access:
(): 'uvicorn.logging.AccessFormatter'
datefmt: '%b-%d-%Y %I:%M:%S %p'
fmt: '%(asctime)s %(levelprefix)-9s [%(module)s:%(lineno)d] %(client_addr)s - %(status_code)s'
use_colors: False
error:
(): 'uvicorn.logging.DefaultFormatter'
datefmt: '%b-%d-%Y %I:%M:%S %p'
fmt: '%(asctime)s %(levelprefix)-9s [%(module)s:%(lineno)d] - %(message)s'
use_colors: False
handlers:
default:
class: logging.FileHandler # Can be changed to StreamHandler for stdout logging
formatter: default
filename: default.log
access:
class: logging.FileHandler # Can be changed to StreamHandler for stdout logging
formatter: access
filename: access.log
error:
class: logging.FileHandler # Can be changed to StreamHandler for stdout logging
formatter: error
filename: default.log
loggers:
uvicorn:
propagate: True
level: INFO
handlers:
- default
uvicorn.error:
propagate: True
level: INFO
handlers:
- error
uvicorn.access:
propagate: True
level: INFO
handlers:
- access