Skip to main content

A modern way to auto log system errors

Project description


Features

  • Deduplicated Logging: Prevents duplicate log entries within each log file, keeping your logs concise and clean.
  • Per-Level Log Files: Saves log entries to separate files by level (Debug.txt, Info.txt, Warning.txt, Error.txt, Critical.txt) for easy tracking and analysis.
  • Automatic Log Cleanup: Periodically purges log entries older than your retention window (default: 24 hours), with full customization.
  • Thread-Safe: All logging and cleanup operations are safe for multi-threaded environments.
  • Console Output: Only errors and critical logs are printed to the console by default, with consistent formatting.
  • Flexible Integration: Just call HoloLog(logsDir) and start logging—no need to rewrite your codebase.

Installation

pip install HoloLog

Quick Start

from HoloLog import HoloLog
from pathlib import Path
import logging

# Initialize HoloLog (set your desired logs directory)
logsDir = Path("logs")
HoloLog(logsDir)

logger = logging.getLogger(__name__)

# Use standard logging
def loggingErrorTest():
    try:
        # Simulate an error for testing
        raise ValueError("This is a test error for logging.")
    except Exception as e:
        logger.error(f"An error occurred", exc_info=True)

How It Works

  • Deduplication: HoloLog compares each new log entry (except the timestamp/level prefix) to recent entries in its level’s file and writes only unique messages.
  • Cleanup: Log files are automatically cleaned in the background, keeping only entries within your retention window (default: 24 hours, configurable with LOG_RETENTION_HOURS in your .env or environment).
  • Retention: Customize how long logs are kept by setting the LOG_RETENTION_HOURS environment variable.

Configuration

  • Log Directory: Pass any Path to HoloLog(). Directory will be created if missing.

  • Log Retention: Set the number of hours to keep log entries:

    LOG_RETENTION_HOURS=48
    

    (in your .env or system environment)

  • Threaded Cleanup: HoloLog launches a daemon thread to clean logs every hour. No user intervention needed.


Advanced Usage

  • Multiple Loggers: All loggers in your app will use the same log directory and handlers by default.

Notes

  • HoloLog is compatible with Python 3.8+ and all standard logging calls.
  • Log file deduplication works at the message-body level for maximum efficiency.
  • HoloLog is optimized for long-running, high-traffic, or mission-critical systems.

Code Examples

You can find code examples on my GitHub repository.


License

This project is licensed under the Apache License, Version 2.0. Copyright 2025 Tristan McBride Sr.


Acknowledgements

Project by:

  • Tristan McBride Sr.
  • Sybil

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

hololog-0.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

hololog-0.1.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file hololog-0.1.0.tar.gz.

File metadata

  • Download URL: hololog-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for hololog-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7def48d0a21dd738953fc27a90e8efc68811031506f1e557b2b2a635fef12315
MD5 c8d64b8a1a50c9af0815a8898deb2017
BLAKE2b-256 ab85875bd64e7a908bccdd9f0ae2987d3f3ce314cc568a4f88ff8fe04e207bc9

See more details on using hashes here.

File details

Details for the file hololog-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hololog-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for hololog-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ce6b16ad2c1ab882a76fa3ddf1aef87d097eea1d829a7b62fa7d19abe3a4674a
MD5 abd1d4d7eb36846b962fdfb04a15eb19
BLAKE2b-256 66e7e8b53f46cb3607db5b002bd601ff8be6be8ec0f5fcd260ca6e7838d6afdb

See more details on using hashes here.

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