Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

endpoint-filter

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

endpoint-filter

An endpoint filter for the standard library logging module.

  • 0.1.3
  • PyPI
  • Socket score

Maintainers
1

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"}

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc