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)
  • 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.1.0.tar.gz (5.7 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.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastapi_audit_log-1.1.0.tar.gz
  • Upload date:
  • Size: 5.7 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.1.0.tar.gz
Algorithm Hash digest
SHA256 51d20f4480ed78e53a71a0597fe64b8ad461f499be2ec683188a59483a2d1739
MD5 19dcbdaec3df3e0ff2b861686dc51244
BLAKE2b-256 32a998832f1030bab67e7d57e535f3bb85b88cf230e843b0ebb66a0491963f9b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastapi_audit_log-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b78c4c9f3e23910e70a171fc528213c963cbb8c30122136a3cac08db0322f73f
MD5 e5775d9a87125990a3d8d317bf7784ea
BLAKE2b-256 a1fbad381a56d69a500b72676702304d33e5a9613b27ec66e7f021ee141dcff2

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