https://github.com/arrmansa/fastapi-logging-tests
log unique request id, while replacing newlines for a good log format
https://github.com/arrmansa/fastapi-logging-tests
fastapi logging python3
Last synced: about 1 month ago
JSON representation
log unique request id, while replacing newlines for a good log format
- Host: GitHub
- URL: https://github.com/arrmansa/fastapi-logging-tests
- Owner: arrmansa
- License: unlicense
- Created: 2022-12-15T11:42:14.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-17T14:35:30.000Z (over 3 years ago)
- Last Synced: 2025-01-22T18:09:35.222Z (over 1 year ago)
- Topics: fastapi, logging, python3
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fastapi-logging-tests
tests with contextvars and adding a custom arrtibute to the log record with https://docs.python.org/3/library/logging.html#logrecord-objects when multithreading
tested with
```bash
time yes -- '-f' | head -20 | xargs -n 1 -P 20 \
curl http://0.0.0.0:5432/test \
--write-out "" --silent --output null
```
Uses .replace to eliminate newline spam
Changes the recordfactory to add uuid