Skip to content

Releases: LarsGMortensen/LiteLog

LiteLog v1.0.0 - Initial Stable Release

18 Sep 19:59

Choose a tag to compare

LiteLog v1.0.0 - Initial Stable Release 🎉

This is the first stable release of LiteLog, a lightweight and high-performance JSON logger for PHP.
After extensive testing, LiteLog is now production-ready with robust concurrency safety, log rotation, and clear documentation.


✨ Highlights

  • Atomic append with per-file mutex (.lock files)
    Ensures multiple processes can log concurrently without losing lines.

  • Safe log rotation
    Automatic rotation on file size threshold, plus immediate post-write check.

  • Retention policy
    Configurable pruning of rotated files (null = no pruning).

  • Strict JSON encoding
    Structured log lines with timestamp, category, message, and optional context.
    Encoding failures trigger exceptions (RuntimeException).

  • Filename sanitization
    Prevents path traversal - only clean basenames allowed.

  • UTC ISO-8601 timestamps
    Consistent log time in DATE_ATOM format.

  • Fail-fast philosophy
    Directory missing? Not writable? Encoding error? -> LiteLog throws immediately.


🧪 Verified by Tests

LiteLog includes a complete test suite in /tests:

  1. Sanity test (test_litelog_new.php)
    Validates JSON encoding, rotation, retention, sanitization.

  2. Micro-benchmark (bench_litelog.php, bench_litelog_web.php)
    Measures performance
    ~1.8–2.1k ops/s (≈10–15% overhead for concurrency safety)

  3. Concurrency test (concurrency_run.*)
    Spawns multiple PHP processes writing to the same log file.
    ✅ 400,000 lines written with no loss, no duplicates under rotation.


📦 Composer

composer require larsgmortensen/litelog
  • Requires PHP 8.0+
  • Explicit dependency on ext-json

📖 Documentation

  • Root README.md covers features, API, usage notes, and fun examples.
  • /tests/README.md documents the test suite and real benchmark results.

✅ Status

LiteLog is now production-ready:

  • Strong documentation and clear API
  • Verified performance on Windows + shared hosting
  • Proven concurrency-safety under heavy load

Enjoy reliable JSON logging without the bloat 🚀
If you find LiteLog useful, give it a ⭐ on GitHub!