lindemannrock/craft-logging-library

Reusable logging library for Craft CMS plugins

Maintainers

Package info

github.com/LindemannRock/craft-logging-library

Documentation

Type:craft-plugin

pkg:composer/lindemannrock/craft-logging-library

Statistics

Installs: 497

Dependents: 15

Suggesters: 0

Stars: 0

Open Issues: 0

5.13.0 2026-06-24 18:25 UTC

README

Logging Library

Logging Library for Craft CMS

Latest Version Craft CMS PHP License

A reusable logging library for Craft CMS plugins that provides consistent logging, dedicated log files, and a built-in log viewer interface.

Features

  • Dedicated Log Files — each plugin gets its own daily log files in storage/logs/
  • Built-in Log Viewer — web interface for viewing, filtering, searching, and downloading logs
  • Standalone System Log Viewer — browse all Craft, plugin, and PHP logs from one interface
  • Control Panel Section — access the standalone viewer from Logging Library → All Logs when the CP section is enabled
  • Control Panel Settings — display name, menu visibility, entries-per-page, and timestamp format, all overridable from config/logging-library.php
  • LoggingTrait — drop-in trait with logInfo(), logWarning(), logError(), logDebug()
  • LoggingService API — direct logging, log statistics, recent entries, and cleanup
  • High Performance Caching — indexed file-based cache for large log viewer pages, with ArrayQuery compatibility for API callers
  • Multi-Format Parsing — automatically detects plugin, Craft CMS, and PHP error log formats
  • Edge Detection — auto-disables log viewer on edge/CDN platforms like Servd
  • Monolog Integration — uses Craft 5's Monolog system with proper PSR-3 standards
  • Configurable — customizable log levels, retention, permissions, and sidebar menus

Requirements

  • Craft CMS 5.10+
  • PHP 8.2+

Installation

Composer

composer require lindemannrock/craft-logging-library && php craft plugin/install logging-library

DDEV

ddev composer require lindemannrock/craft-logging-library && ddev craft plugin/install logging-library

Documentation

Full documentation is available in the docs folder.

Support

License

This plugin is licensed under the MIT License. See LICENSE for details.

Developed by LindemannRock