-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlogger_config.yaml
49 lines (49 loc) · 1.31 KB
/
logger_config.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
version: 1
disable_existing_loggers: False
formatters:
default:
(): uvicorn.logging.DefaultFormatter
format: '{levelprefix} [{asctime}] {thread} {filename} {funcName} {lineno} {message}'
style: '{'
datefmt: '%d-%m-%Y %H:%M:%S'
colours_removed:
(): uvicorn.logging.DefaultFormatter
format: '{levelname} [{asctime}] {thread} {filename} {funcName} {lineno} {message}'
style: '{'
handlers:
console:
formatter: default
class: logging.StreamHandler
stream: ext://sys.stdout
rotating_file:
formatter: colours_removed
class: logging.handlers.RotatingFileHandler
filename: ./logs/fastapi_learning.log
maxBytes: 4096
backupCount: 5 # Keep 5 old log files
encoding: utf-8
queue_rotating_file:
class: logging.handlers.QueueHandler
# queue: fastapi_learning.common.queue_logging.queue_factory
# listener: fastapi_learning.common.queue_logging.CustomListener
handlers:
- rotating_file
loggers:
# uvicorn.error is also valid. It is the equivalence of root.
# uvicorn.error:
# level: INFO
# handlers:
# - console
# - qhand
# propagate: no
fastapi_learning.debug:
level: DEBUG
handlers:
- console
- queue_rotating_file
propagate: no
root:
level: INFO
handlers:
- console
- queue_rotating_file