simsys-logevent (Python)
Structured JSON log events for Python apps, designed for
systemd-journal → Loki pipelines (Grafana Alloy loki.source.journal).
Every call writes one JSON line to stdout.
Intentionally minimal — a stable schema, a configured service name, and never-throws guarantees. No transports, no batching, no sampling. Loki and LogQL handle querying.
This is the Python lane of a three-SDK repo (Node, Python, Go) that all emit the same event envelope. Full documentation, including the shared schema and cardinality guidance, lives in the repository README.
Install
Not yet on PyPI. Install from the repository subdirectory:
pip install "simsys-logevent @ git+https://github.com/Simmons-Systems/simsys-logevent.git#subdirectory=python"
Usage
from simsys_logevent import configure, log_event, log_error
configure(service="board-portal")
log_event(
event="auth.signin",
user="u_8f2c1a94", # stable internal ID, not an email
route="/api/auth/callback/google",
outcome="success",
)
try:
...
except Exception as err:
log_error("db.query.failed", err, route="/api/shifts")
Emits one JSON line per call:
{"user": "u_8f2c1a94", "route": "/api/auth/callback/google", "outcome": "success", "ts": "2026-04-27T12:34:56.789Z", "level": "info", "level_code": 2, "service": "board-portal", "hostname": "bfr", "pid": 12345, "event": "auth.signin"}
Schema
Every emitted object includes ts, level, level_code, service,
hostname, pid, and event. Library-set fields always win over
caller-supplied keys of the same name, so payloads cannot spoof system
metadata.
Level codes are debug=1, info=2, warn=3, error=4.
Configuration
configure() is the only function that raises. It rejects a missing,
non-string, empty, or whitespace-only service, and a default_level
outside debug/info/warn/error. Nothing is mutated when
configuration is rejected, and the service name is stored trimmed.
An invalid per-event level is not an error — it normalizes to the configured default, so a bad level never costs you the log line.
service defaults to "unknown", and logging before configure()
emits normally rather than failing: a misconfigured bootstrap is exactly
when logs matter most. Treat {service="unknown"} in Loki as a bug
signal.
Sensitive data
This library preserves arbitrary caller fields verbatim and performs no
redaction. Never log passwords, API secrets, private keys, tokens,
session cookies, Authorization headers, or full request bodies. Prefer
a stable internal user ID over an email address — log_error() also
copies the exception message and full traceback into the event, and
neither is guaranteed free of sensitive data.
License
MIT. See LICENSE.
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 simsys_logevent-1.0.0.tar.gz.
File metadata
- Download URL: simsys_logevent-1.0.0.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
394f08e4e6eefb2c6bc32f6c993aefea3fb1be36b9bf151af1cd292080a80262
|
|
| MD5 |
ea430174e2558f0dbcc1f81812eee888
|
|
| BLAKE2b-256 |
855af57228c9f12eecac8bd77932f0a39d4424feb8217d74c470daeef702e27c
|
Provenance
The following attestation bundles were made for simsys_logevent-1.0.0.tar.gz:
Publisher:
release.yml on Simmons-Systems/simsys-logevent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simsys_logevent-1.0.0.tar.gz -
Subject digest:
394f08e4e6eefb2c6bc32f6c993aefea3fb1be36b9bf151af1cd292080a80262 - Sigstore transparency entry: 2582071175
- Sigstore integration time:
-
Permalink:
Simmons-Systems/simsys-logevent@155dac78b7ee8a8425d003c478c7d5d13cc153da -
Branch / Tag:
refs/tags/python/v1.0.0 - Owner: https://github.com/Simmons-Systems
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@155dac78b7ee8a8425d003c478c7d5d13cc153da -
Trigger Event:
push
-
Statement type:
File details
Details for the file simsys_logevent-1.0.0-py3-none-any.whl.
File metadata
- Download URL: simsys_logevent-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70ec0aabcc2219f7eae4981d1747bd41c569b05d0a64905b72bf75b8496205ea
|
|
| MD5 |
24dea759c8b2d269675eddadc1e5dfdd
|
|
| BLAKE2b-256 |
a1357c5761bc2881e75d471809cc00032d08bea42f80687efd95ebd96758d0a5
|
Provenance
The following attestation bundles were made for simsys_logevent-1.0.0-py3-none-any.whl:
Publisher:
release.yml on Simmons-Systems/simsys-logevent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simsys_logevent-1.0.0-py3-none-any.whl -
Subject digest:
70ec0aabcc2219f7eae4981d1747bd41c569b05d0a64905b72bf75b8496205ea - Sigstore transparency entry: 2582071184
- Sigstore integration time:
-
Permalink:
Simmons-Systems/simsys-logevent@155dac78b7ee8a8425d003c478c7d5d13cc153da -
Branch / Tag:
refs/tags/python/v1.0.0 - Owner: https://github.com/Simmons-Systems
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@155dac78b7ee8a8425d003c478c7d5d13cc153da -
Trigger Event:
push
-
Statement type: