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-0.1.1.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-0.1.1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastapi_audit_log-0.1.1.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-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4dc096a05001a77b80c8c236797f412126ebf7aa425ab7f202ee4b0b5f096645
MD5 809975fcf8bc4ee5f6d2e2afd43a3eb9
BLAKE2b-256 56e1f89c3c897b0e7b0e3b5eadbe686cfb9e23faab46a80d3a0513de6714d35c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastapi_audit_log-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f694cc1bc85a70c5a6623c537d3bfc0e0fb7189e034c49fa0b25a00bf3a14fa7
MD5 b55c4e310cadb8f07e8b158cc69ab449
BLAKE2b-256 8bc07ed22263c153a6a1bb8fb06388a43e58a1733fa246dbaec7b5ff5521535c

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