Structured JSON logger with trace_id, user_id and colored console output.
Project description
traceloggerx
✨ A Python logging utility with colorful console output and structured JSON file logging. Built for real-world debugging and traceability.
Features
- Colorful console logs using
colorlog - JSON structured logs with
trace_idanduser_id - Automatic exception capturing via
sys.excepthook - Easily reusable across different projects
Installation
pip install traceloggerx
Usage
from logutils.logger import set_logger
# Create a logger with a default user_id
logger = set_logger("myapp", json_format=True, extra={"user_id": "anonymous"})
# Add a trace_id dynamically when logging
logger.info("User accessed dashboard", extra={"trace_id": "req-001"})
License
MIT
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
traceloggerx-0.1.0.tar.gz
(2.2 kB
view details)
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 traceloggerx-0.1.0.tar.gz.
File metadata
- Download URL: traceloggerx-0.1.0.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90eed2a6edf073a65b2b6779a917d9e540ff01fbaf579fa3036b57726813478b
|
|
| MD5 |
16459b8d98d368932a0e40de7defb388
|
|
| BLAKE2b-256 |
6231a5555fa6c3b49e0514870b606c4eb35d4e3d1dc29993a22feddcf96b4f0b
|
File details
Details for the file traceloggerx-0.1.0-py3-none-any.whl.
File metadata
- Download URL: traceloggerx-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f25195ce96e06cbc7e56829c728af79dcf23ea82ccbaf1090e24c6801004c81
|
|
| MD5 |
42a6e941c0dc2304a9c3e2e1cf47ed2a
|
|
| BLAKE2b-256 |
8e412c3b0596888093beb44c00ab7d7764f6a91a1db48ddb81cf4cbd65bce970
|