Skip to main content

Structured ASGI request logging and remote log aggregation for FastAPI/Starlette.

Project description

Starlette Healthcheck — Python

Structured ASGI request logging middleware and log aggregation for Starlette/FastAPI applications.

Features

  • ASGI middleware — logs each request method, path, status code, and duration
  • Structured logging — configurable console output with standard datetime formatting
  • Remote log aggregation — sends log entries to a centralised collector service (configurable endpoint and API key)
  • Thread-safe startup registration — non-blocking handler registration on initialisation

Installation

pip install starlette-healthcheck

Quick Start

from starlette_healthcheck import configure_logging, HealthcheckMiddleware
from fastapi import FastAPI

configure_logging(level="INFO")

app = FastAPI()
app.add_middleware(HealthcheckMiddleware)

Consuming in Your App

pip install starlette-healthcheck
from starlette_healthcheck import configure_logging, HealthcheckMiddleware

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

starlette_healthcheck-1.2.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

starlette_healthcheck-1.2.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file starlette_healthcheck-1.2.0.tar.gz.

File metadata

  • Download URL: starlette_healthcheck-1.2.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for starlette_healthcheck-1.2.0.tar.gz
Algorithm Hash digest
SHA256 2da01bb584cd5b1a794f8a3f6609bebd88ed6afdf7cd28eed46ca7fb2fd9aa9f
MD5 502cec328eef173136602e786c9de5a5
BLAKE2b-256 c2282f0f6bfd2807cee577636f22b8771f9584b068faea9a94217094d18a5396

See more details on using hashes here.

File details

Details for the file starlette_healthcheck-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for starlette_healthcheck-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5490113ace22f5727765acfb4b599c82ded7f050dea4d535c68a14088120c1b3
MD5 fcc945795c6014cae764c27eb6332156
BLAKE2b-256 7723f8a04367b6575c3e0f1eeff71972fd2f7d16e53f44324ed166550701060a

See more details on using hashes here.

Supported by

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