HESTIA is a high-performance, structured logging system for Python applications. Supports async logging, Elastic Stack integration, structured JSON logs, and colorized console output.
Project description
HESTIA Logger
A high-performance, structured logging system for Python applications.
Supports async logging, Elastic Stack integration, structured JSON logs, and colorized console output.
Key Features
- Structured JSON & Human-Readable Logs (Optimized for Elastic Stack)
- Dynamic Metadata Support (
user_id,request_id, etc.) - Application-Aware Logging (
get_logger("my_app")) - Multi-Thread & Multi-Process Friendly (
thread_id,process_id) - Colored Console Output (
INFOin green,ERRORin red, etc.) - Internal Logger for Debugging the Logging System
- Supports File Rotation & Future Cloud Integration
Documentation
The full documentation is available on GitHub Pages.
Installation
pip install hestia-logger
Usage
1. Basic Setup
from hestia_logger import get_logger
# Get a logger instance
logger = get_logger("development")
# Log messages with different levels
logger.debug("This is a DEBUG log")
logger.info("Application started successfully")
logger.warning("Low disk space warning")
logger.error("Failed to connect to database")
logger.critical("System is down!")
2. Decorator Example
from hestia_logger import get_logger
from hestia_logger.decorators import log_execution
# Initialize the logger
logger = get_logger("decorator")
@log_execution
def add_numbers(a, b):
"""Adds two numbers and returns the result."""
return a + b
@log_execution
def simulate_task():
"""Simulates a task that takes time."""
import time
time.sleep(2)
return "Task completed!"
# Call the functions
if __name__ == "__main__":
result = add_numbers(5, 10)
logger.info(f"Result: {result}")
task_status = simulate_task()
logger.info(f"Task Status: {task_status}")
3. Adding Custom Metadata
from hestia_logger import get_logger
logger = get_logger("my_application", metadata={"user_id": "12345",
"request_id": "abcd-xyz"})
logger.info("User login successful")
Log File Structure
HESTIA Logger creates two main log files:
| File | Format | Purpose |
|---|---|---|
| app.log | JSON | Machine-readable (Elastic Stack) |
| all.log | Text | Human-readable debug logs |
Log Colors (Console Output)
| Log Level | Color |
|---|---|
| DEBUG | 🔵 Blue |
| INFO | ⚫ Black |
| WARNING | 🟡 Yellow |
| ERROR | 🔴 Red |
| CRITICAL | 🔥 Bold Red |
Configuration
HESTIA Logger supports environment-based configuration via .env or export:
# Environment Variables
ENVIRONMENT=local
LOG_LEVEL=INFO
Example Log Output
Console (Colorized) + all.log (Text Format)
2025-03-06 20:40:23 - my_application - INFO - Application started!
app.log (JSON Format - Elastic Stack Ready)
{
"timestamp": "2025-03-06T20:40:23.286Z",
"level": "INFO",
"hostname": "server-1",
"container_id": "N/A",
"application": "my_application",
"event": "Application started successfully!",
"thread": 12345,
"process": 56789,
"uuid": "d3f5b2c1-4f27-46a8-b3d2-f4a7a5c3ef29",
"metadata": {
"user_id": "12345",
"request_id": "abcd-xyz"
}
}
License
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
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 hestia_logger-1.0.0.tar.gz.
File metadata
- Download URL: hestia_logger-1.0.0.tar.gz
- Upload date:
- Size: 17.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0731983478404ffe4a027380db4b2d7b7f06a9e49b510452b235d922e20f4298
|
|
| MD5 |
bf51a04ab24e747eb9d47f4152ac555f
|
|
| BLAKE2b-256 |
8dbccbdaf84782e7c633616f26fe634d3e70444dafd6798ddf8bde0c9594e53a
|
Provenance
The following attestation bundles were made for hestia_logger-1.0.0.tar.gz:
Publisher:
publish-to-pypi.yml on fox-techniques/hestia-logger
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hestia_logger-1.0.0.tar.gz -
Subject digest:
0731983478404ffe4a027380db4b2d7b7f06a9e49b510452b235d922e20f4298 - Sigstore transparency entry: 185597034
- Sigstore integration time:
-
Permalink:
fox-techniques/hestia-logger@0841d5ccef7c18371c9ac04213378c0a41e903f0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/fox-techniques
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@0841d5ccef7c18371c9ac04213378c0a41e903f0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file hestia_logger-1.0.0-py3-none-any.whl.
File metadata
- Download URL: hestia_logger-1.0.0-py3-none-any.whl
- Upload date:
- Size: 23.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f02c63a8eb9eac8945a66e3d0b6eae53bf11109fe34c4832a2b2c7f16678cba9
|
|
| MD5 |
a6b76fdb38fb536d7a917a4d2d4ed676
|
|
| BLAKE2b-256 |
c803a2cf939e1b0c105fffcc15c13c5e54e32694f9c6c43f9e15ab1d876cadfe
|
Provenance
The following attestation bundles were made for hestia_logger-1.0.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on fox-techniques/hestia-logger
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hestia_logger-1.0.0-py3-none-any.whl -
Subject digest:
f02c63a8eb9eac8945a66e3d0b6eae53bf11109fe34c4832a2b2c7f16678cba9 - Sigstore transparency entry: 185597035
- Sigstore integration time:
-
Permalink:
fox-techniques/hestia-logger@0841d5ccef7c18371c9ac04213378c0a41e903f0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/fox-techniques
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@0841d5ccef7c18371c9ac04213378c0a41e903f0 -
Trigger Event:
push
-
Statement type: