Skip to main content

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

fastapi_audit_log-1.2.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_audit_log-1.2.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_audit_log-1.2.0.tar.gz.

File metadata

  • Download URL: fastapi_audit_log-1.2.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for fastapi_audit_log-1.2.0.tar.gz
Algorithm Hash digest
SHA256 4e8053c40ca777d30fa1e865746abf69d43aab8f1425c4036ed1c368a1f5d856
MD5 25d96de64181733679bd916324133031
BLAKE2b-256 713a1df96db9d81f7d2509b4b7f22c940488091216de04423d714d81538798f4

See more details on using hashes here.

File details

Details for the file fastapi_audit_log-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_audit_log-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 20f577462b2dfe7b843a0fec0693b4278281331e79328df00a9472f3aa9ea5a2
MD5 e42cb2576e4bcf835c10a4be8f9d648d
BLAKE2b-256 2dc527d72ba2613c9d59f5fb150bf52e34d23d3e4612e6d7cc91af342c5a0c20

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page