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.0.tar.gz (2.5 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.0-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastapi_audit_log-0.1.0.tar.gz
  • Upload date:
  • Size: 2.5 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.0.tar.gz
Algorithm Hash digest
SHA256 00067a604e269f33184ee6e4efbc02c23e05641bd4b99d279f722ed8b21026df
MD5 66def70321e271a45c4dcc51bdc83a4e
BLAKE2b-256 49119a995bfd195de0dd0aff3198236e36395a0df09c0c7397b5b89a0633a8af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastapi_audit_log-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 949296a1039687909c1ef8f6a7a4e02fd9f0ef6f1125778eff81b44ac8549ac0
MD5 fb0371c0e26d62acc4329e51f9184d91
BLAKE2b-256 76a3bb4fbd5786200dd77fef9be28190cd91d1b1d5823eb8d71371cb22f57829

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