Skip to main content

A lightweight audit logging library with pluggable backends

Project description

Litewave Audit Library

Internal audit logging library for Litewave services.

Usage

from litewave_audit_lib import get_logger

# Get a logger with NATS backend
logger = get_logger(
    backend="nats",
    servers=["nats://your-nats-server:4222"],
    subject="audit.logs",
    username="your_username",
    password="your_password",
    max_retries=3,        # Optional: Maximum number of reconnection attempts
    retry_delay=1.0       # Optional: Delay between reconnection attempts in seconds
)

# Log an audit event
logger.log(
    who="user123",
    resource="document",
    action="view",
    location="office",
    request_context={"ip": "127.0.0.1"},
    context={"document_id": "doc123"},
    client="web"
)

Features

  • Automatic reconnection handling
  • Connection retry logic
  • Proper error handling and logging
  • Type hints for better IDE support
  • Automatic cleanup of NATS connections

Dependencies

  • nats-py (for NATS backend)

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

litewave_audit_lib-0.1.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

litewave_audit_lib-0.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: litewave_audit_lib-0.1.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for litewave_audit_lib-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d390741efb9f02abf7e12b1b39a7846d26ea123a76b04ff0ddf5f1a15e8c500c
MD5 3c3cbf9698e733ac6fdbcab086920eb0
BLAKE2b-256 92d5f86de2ad15f44181def330e0015dd8f9d652bb48074304d6da47b5e97d1f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for litewave_audit_lib-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4dde413541930adcefc8edd1eab3902c6d46d10269cd9b8935ef2cdd84006926
MD5 8e3b3c8e4c77c6677737311858c85bb3
BLAKE2b-256 dd8cf1e6bf039ef2908eb75caca0de59936591f9ef2434f8c475c274719d5cbf

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