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.1.tar.gz (7.9 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.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: litewave_audit_lib-0.1.1.tar.gz
  • Upload date:
  • Size: 7.9 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.1.tar.gz
Algorithm Hash digest
SHA256 02458a6e25e80eb5617e2e55df0ae5cae699d18c31ab27a25e7b452fd4d02fe2
MD5 90347bbbf16a9c799bdce56c59dbd281
BLAKE2b-256 72cec1a4fa80a98ad39d8e70159ddd8b6569550ea219ba1e99cc26983aa9bcee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for litewave_audit_lib-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bdff2044b92810ecf29c2657bcc10a1f3726a6ddbe91212a76d865e3659bb75b
MD5 83a1bdb08f5421eefcf620230ad50616
BLAKE2b-256 7f1da101a083ac31103a32f4b4c2067bba9d19cf5020b581b98ba993a216589e

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