Colored, normalizes and joins logs between Uvicorn and Gunicorn.
Project description
Guvicorn_logger
This lib colored, normalizes and joins logs between Uvicorn and Gunicorn. There is a common problem when using Uvicorn for Dev and Gunicorn for Prod, normally the logs generated by Uvicorn wokers are not captured by Gunicorn.
This lib facilitates this configuration...
Easy config
from guvicorn_logger import Logger
logger = Logger().configure()
Example
logger.info("Message - Info")
logger.error("Message - Error")
logger.warning("Message - Warning")
logger.critical("Message - Critical")
Output
- Framework (Uvicorn, Gunicorn, Fastapi)
FastAPI | asgi-correlation-id
from asgi_correlation_id import CorrelationIdMiddleware
from fastapi import FastAPI
from guvicorn_logger import Logger
app = FastAPI()
app.add_middleware(CorrelationIdMiddleware)
logger = Logger(correlation_id=True).configure()
@app.get("/")
def main():
logger.info("Message - Info")
logger.error("Message - Error")
logger.warning("Message - Warning")
logger.critical("Message - Critical")
Output
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file guvicorn_logger-0.1.17.tar.gz
.
File metadata
- Download URL: guvicorn_logger-0.1.17.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.2 Linux/6.5.0-1022-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36d75fc8dee2be375c197af4cfa030e3e27e292ce432ffd0f4a46ac8c8e1a74a |
|
MD5 | 35a8cae505b0970434e4b04707981f35 |
|
BLAKE2b-256 | 57a179ca19c7fbbd8370185ba0b524280789f327318c46e8525def3b6362096f |
File details
Details for the file guvicorn_logger-0.1.17-py3-none-any.whl
.
File metadata
- Download URL: guvicorn_logger-0.1.17-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.2 Linux/6.5.0-1022-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a65ce9522d11ada1ad7263be6894ab82bfc0784c29a9407b0b3599fef1024c2 |
|
MD5 | 5dfb119b55bdd243540f5db6c81e6a31 |
|
BLAKE2b-256 | 6adb372df0e331a981721c6253a5e5cba851591dff13866e68d2eed28bc27a71 |