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="/live", verb="POST"))
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"}
Release files for endpoint-filter 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| endpoint_filter-0.1.3.tar.gz | 2.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| endpoint_filter-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.0 kB
Release files / endpoint_filter-0.1.3.tar.gz
| Download URL | endpoint_filter-0.1.3.tar.gz |
|---|---|
| Size | 2.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3085e4eaae6da4e296e31424f0a00cc9897ac70c9b7357e10e9e91c2312586e7
|
|
BLAKE2b-256 checksum How to use checksums |
419b7c202b4ae6e08ec4f6bd2e8d4ce7819e4d759c4a0c691ccdb6e8ddf2f3c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.3 Windows/11
|
Release files / endpoint_filter-0.1.3-py3-none-any.whl
| Download URL | endpoint_filter-0.1.3-py3-none-any.whl |
|---|---|
| Size | 3.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1b81eb7cfcdcd56e645ac649d14cb0ba5f756e640ea4e61fc62aaeb7d6b6c988
|
|
BLAKE2b-256 checksum How to use checksums |
c50ca88195609f4726a28ad98426f5fe0c02f4d101a96583243da3ad21a484ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.3 Windows/11
|