Metadata-Version: 2.4
Name: fastapi-audit-log
Version: 0.1.0
Summary: Audit logging middleware for FastAPI apps
Author: Your Name
Author-email: Nithishraj T <nithishrajt.dev@gmail.com>
License: MIT
Keywords: fastapi,audit,logging,middleware
Classifier: Programming Language :: Python :: 3
Classifier: Framework :: FastAPI
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi>=0.100
Requires-Dist: sqlalchemy>=1.4
Requires-Dist: starlette>=0.28
Provides-Extra: mysql
Requires-Dist: pymysql>=1.0; extra == "mysql"
Provides-Extra: postgres
Requires-Dist: psycopg2-binary>=2.9; extra == "postgres"
Provides-Extra: oracle
Requires-Dist: cx_Oracle>=8.0; extra == "oracle"
Dynamic: license-file

# FastAPI Audit Log

`fastapi-audit-log` is a middleware package for **FastAPI** that automatically logs API requests and responses to a database. It supports **MySQL, PostgreSQL, Oracle**, and **SQLite**.

## Features

- Logs requests and responses for POST, PUT, PATCH, DELETE methods
- Skips files in multipart/form-data
- Background DB writes for non-blocking performance
- Automatic cleanup of old logs (configurable retention)
- Exclude specific paths (e.g., `/health`, `/users`)
- Works with MySQL, PostgreSQL, Oracle, SQLite

## Installation

```bash
# Install main package
pip install fastapi-audit-log

# Optional database drivers
pip install fastapi-audit-log[mysql]      # MySQL
pip install fastapi-audit-log[postgres]   # PostgreSQL
pip install fastapi-audit-log[oracle]     # Oracle
