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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e272e55bc4df53f8605ceaf7b9467a69def7fc8e9e35161ccf5b4c909907bc7b
|
|
| MD5 |
66301932c9948d51a819106070e27de3
|
|
| BLAKE2b-256 |
75f25ad061cd5e64ca0c9b3415567c49bfda3e1673d1b143727b2411de836506
|
Provenance
The following attestation bundles were made for loginformant-1.0.0.tar.gz:
Publisher:
publish-python.yml on Sergey-PrudentDev/loginformant
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
loginformant-1.0.0.tar.gz -
Subject digest:
e272e55bc4df53f8605ceaf7b9467a69def7fc8e9e35161ccf5b4c909907bc7b - Sigstore transparency entry: 1355782550
- Sigstore integration time:
-
Permalink:
Sergey-PrudentDev/loginformant@152a28c31761afff3aae8d9c0b5df2d5a8f615b9 -
Branch / Tag:
refs/tags/python/v1.0.0 - Owner: https://github.com/Sergey-PrudentDev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@152a28c31761afff3aae8d9c0b5df2d5a8f615b9 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cdfffc96d7d7ad59ac6ca09961ca990e4e780c2a74b09ae6e47364d51d8d4f87
|
|
| MD5 |
78a4e52df5c831554f8b182452537a97
|
|
| BLAKE2b-256 |
c4c2c58d20a36d6332c6b2e16cf7fbd758f82c1069d4bc0429a87eff2030e18b
|
Provenance
The following attestation bundles were made for loginformant-1.0.0-py3-none-any.whl:
Publisher:
publish-python.yml on Sergey-PrudentDev/loginformant
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
loginformant-1.0.0-py3-none-any.whl -
Subject digest:
cdfffc96d7d7ad59ac6ca09961ca990e4e780c2a74b09ae6e47364d51d8d4f87 - Sigstore transparency entry: 1355782567
- Sigstore integration time:
-
Permalink:
Sergey-PrudentDev/loginformant@152a28c31761afff3aae8d9c0b5df2d5a8f615b9 -
Branch / Tag:
refs/tags/python/v1.0.0 - Owner: https://github.com/Sergey-PrudentDev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@152a28c31761afff3aae8d9c0b5df2d5a8f615b9 -
Trigger Event:
push
-
Statement type: