Skip to main content

An endpoint filter for the standard library logging module.

Project description

Endpoint filter for the standard librarys logging module.

This package provides a filter for the standard librarys logging module that filters out log messages based on the request path of a FastAPI application.

Usage

from fastapi import FastAPI
import logging
from endpoint_filter import EndpointFilter

app = FastAPI()
uvicorn_logger = logging.getLogger("uvicorn.access")
uvicorn_logger.addFilter(EndpointFilter(path="/live"))
uvicorn_logger.addFilter(EndpointFilter(path="/endpoint"))



@app.get('/endpoint') # This endpoint will be ignored by the filter
async def endpoint():
    return {"message": "Hello endpoint"}

@app.get('/live') # This endpoint will be ignored by the filter
async def live():
    return {"message": "Hello live"}

@app.get('/')
async def root():
    return {"message": "Hello root"}

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

endpoint_filter-0.1.0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

endpoint_filter-0.1.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file endpoint_filter-0.1.0.tar.gz.

File metadata

  • Download URL: endpoint_filter-0.1.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Windows/11

File hashes

Hashes for endpoint_filter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 189bb7aa95de10b888f6841daa318182aceeb71f3297cc56f3c186df059bfca0
MD5 35ae91bbcd201b59eaf659bc7549783c
BLAKE2b-256 516ad5e4570b75cec3ad5292a9efe49a595ce80882ce759409c443fc46613a00

See more details on using hashes here.

File details

Details for the file endpoint_filter-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for endpoint_filter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e3c528a67b85e4b03b9cd472a9343a9d200340552917bcdbab306b9d04f32ca3
MD5 ae78dfae0a66e09ed319462406d0e6f7
BLAKE2b-256 a1c1c6932d16c010d73a438f4cf195eebfd12b75ee827d0a0b3adf3370fc91df

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