Skip to main content

Python logging handler for LogInformant — centralized log management.

Project description

loginformant

Send logs to LogInformant from Python 3.8+.

Zero external dependencies — uses only the Python standard library.

Install

pip install loginformant

Quick Start

import logging
from loginformant import LogInformantHandler

# Add the handler to the root logger
handler = LogInformantHandler(
    api_url="https://app.loginformant.com",
    api_key="YOUR-API-KEY-HERE",
)
logging.getLogger().addHandler(handler)
logging.getLogger().setLevel(logging.DEBUG)

# Log as normal
logging.info("Server started on port %s", 8080)
logging.warning("High memory usage: %s%%", 87)
logging.error("Database query failed", exc_info=True)

Django

In settings.py:

LOGGING = {
    "version": 1,
    "handlers": {
        "loginformant": {
            "class": "loginformant.LogInformantHandler",
            "api_url": "https://app.loginformant.com",
            "api_key": "YOUR-API-KEY-HERE",
        },
    },
    "root": {
        "handlers": ["loginformant"],
        "level": "WARNING",
    },
}

Flask

import logging
from loginformant import LogInformantHandler
from flask import Flask

app = Flask(__name__)

handler = LogInformantHandler(
    api_url="https://app.loginformant.com",
    api_key="YOUR-API-KEY-HERE",
)
app.logger.addHandler(handler)
logging.getLogger("werkzeug").addHandler(handler)

Structured Logging

Attach extra properties to any log message:

logging.info("Order placed", extra={"order_id": 1234, "total": 59.99})

Options

Parameter Default Description
api_url Your LogInformant API base URL
api_key API key from your application settings
batch_size 50 Max logs per HTTP request
flush_interval 2.0 Seconds between automatic flushes
level NOTSET Minimum log level to send

Log Level Mapping

Python LogInformant
DEBUG Debug
INFO Information
WARNING Warning
ERROR Error
CRITICAL Fatal

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

loginformant-1.0.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

loginformant-1.0.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: loginformant-1.0.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for loginformant-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e272e55bc4df53f8605ceaf7b9467a69def7fc8e9e35161ccf5b4c909907bc7b
MD5 66301932c9948d51a819106070e27de3
BLAKE2b-256 75f25ad061cd5e64ca0c9b3415567c49bfda3e1673d1b143727b2411de836506

See more details on using hashes here.

Provenance

The following attestation bundles were made for loginformant-1.0.0.tar.gz:

Publisher: publish-python.yml on Sergey-PrudentDev/loginformant

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: loginformant-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for loginformant-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cdfffc96d7d7ad59ac6ca09961ca990e4e780c2a74b09ae6e47364d51d8d4f87
MD5 78a4e52df5c831554f8b182452537a97
BLAKE2b-256 c4c2c58d20a36d6332c6b2e16cf7fbd758f82c1069d4bc0429a87eff2030e18b

See more details on using hashes here.

Provenance

The following attestation bundles were made for loginformant-1.0.0-py3-none-any.whl:

Publisher: publish-python.yml on Sergey-PrudentDev/loginformant

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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