Audit logging middleware for FastAPI apps
Project description
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) - Include specific paths (e.g.,
/health,/users) - Works with MySQL, PostgreSQL, Oracle, SQLite
Installation
# 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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastapi_audit_log-1.4.0.tar.gz.
File metadata
- Download URL: fastapi_audit_log-1.4.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2846b00188d483f2a2055833316bb99f4131e9739273125b103192359fdf776
|
|
| MD5 |
6b29957953a76cb1af5ad71bc90e4474
|
|
| BLAKE2b-256 |
638941ba273d12084943b37863ec1f5600e746d00b8ace82a68bc618e933a311
|
File details
Details for the file fastapi_audit_log-1.4.0-py3-none-any.whl.
File metadata
- Download URL: fastapi_audit_log-1.4.0-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d33ee0caa116a4a6f27c8246252eab73bf1e1ad77391f5c9f98323a2a2e06d3
|
|
| MD5 |
923ebb5eaa09c7d6ff9bbd10d673d114
|
|
| BLAKE2b-256 |
f2868679d0ba1c5ba5188b1d05d70c43a5f21ab37d5e02016c0ecb2e505608e8
|