Skip to main content

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) alt text

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

alt text

Project details


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.17.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

guvicorn_logger-0.1.17-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

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

Hashes for guvicorn_logger-0.1.17.tar.gz
Algorithm Hash digest
SHA256 36d75fc8dee2be375c197af4cfa030e3e27e292ce432ffd0f4a46ac8c8e1a74a
MD5 35a8cae505b0970434e4b04707981f35
BLAKE2b-256 57a179ca19c7fbbd8370185ba0b524280789f327318c46e8525def3b6362096f

See more details on using hashes here.

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

Hashes for guvicorn_logger-0.1.17-py3-none-any.whl
Algorithm Hash digest
SHA256 3a65ce9522d11ada1ad7263be6894ab82bfc0784c29a9407b0b3599fef1024c2
MD5 5dfb119b55bdd243540f5db6c81e6a31
BLAKE2b-256 6adb372df0e331a981721c6253a5e5cba851591dff13866e68d2eed28bc27a71

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page