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
guvicorn_logger-0.1.16.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for guvicorn_logger-0.1.16-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e1ac431a5858655530cd450364095e89b62555cafe4f30ae78d8a65e876dfd8 |
|
MD5 | ad5d15d88893270ec3e21b77b320d73d |
|
BLAKE2b-256 | 05e3c9e9c10787ca0115a84947113da6d64b9e06063a481eb930659bcf3c0501 |