Metadata-Version: 2.1
Name: fastapi-route-logger-middleware
Version: 0.1.3
Summary: Simple middleware for FastAPI to generate log entries on all requests
Home-page: https://github.com/jeffsiver/fastapi-route-logger
Author: Jeff Siver
Author-email: jeffsiver@gmail.com
License: UNKNOWN
Keywords: fastapi,logging,middleware
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: fastapi

# fastapi-route-logger
Basic middleware to log requests made to routes in FastAPI applications.

## Installation
```
pip install fastapi-route-logger-middleware
```
## Usage
The component is FastAPI middleware. 
```pythonstub
app.add_middleware(RouteLoggerMiddleware)
```

Additional arguments can be provided, when needed:
* logger - The Logger instance to use. Defaults to the default logger (`logging.getLogger(__name__)`). 
* skip_routes - A list of strings that represent the start of routes that should not be logged. Default is an empty 
list. This is a "begins with" type match so an entry of "/health" will block the routes /health/check and /healthcheck.

The [sample-site](https://github.com/jeffsiver/fastapi-route-logger/tree/master/sample-site) in the code repository
contains a sample FastAPI site with this middleware integrated.

