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

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastapi_audit_log-1.0.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.0.0.tar.gz
Algorithm Hash digest
SHA256 9e3563b7601a686d3582ba41643c84e36f72db7d8b9b9026e56bfecc28d7def2
MD5 26ddf65f8bfa780e985d47b604c804f2
BLAKE2b-256 78220fcef234cb05ad44ed03748a69548d7830431814f7e6fe0de02deffb90e4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastapi_audit_log-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 610e2e13fdc380b7227c75cbfbc6d7248a7c10532524a299d544304ddc86aedb
MD5 6978131c69ceb2e4c5df9c706ea30ef9
BLAKE2b-256 f39b4f2ba5b983f648d993282b800ea8d90dd545f24f4d8bf973be1d28df82ea

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