Logging Library
Logging Library gives every Craft plugin consistent, structured logging — dedicated daily log files, a built-in viewer in the Control Panel, and a drop-in API — without each plugin reinventing it. It's built first and foremost as the shared logging foundation for the LindemannRock plugin suite, where every plugin uses it for its own logging and log viewer. It's also a general-purpose library, so any plugin or your own module can adopt it the same way.
Free, open source (MIT), and built on Craft 5's native Monolog / PSR-3 logging.
What it does — and what it doesn't. Logging Library writes logs to dated files in your site's
storage/logs/and gives you a Control Panel viewer to read them — local, file-based logging built on Craft's own log system. It is not an external log-shipping or APM service, and it doesn't replace your hosting platform's log dashboard. On edge/ephemeral hosting where local files don't persist, it steps aside automatically.
For developers
Drop consistent logging into any plugin with one use and one call — no boilerplate, no per-plugin viewer to build. This is what sets it apart.
- LoggingTrait — add
logInfo(),logWarning(),logError(), andlogDebug()to any class with a singleusestatement. - LoggingService — a static API for direct logging, log statistics, recent entries, and cleanup when you're not inside a class.
- One-line integration — call
LoggingLibrary::configure()in your plugin'sinit(); the viewer, routes, and nav item wire up automatically. - Structured context — pass an array of context with any message and it's stored as JSON alongside the entry.
Log viewer
- Built-in viewer in each plugin's own Control Panel section — browse, filter, search, and download the selected raw log file.
- Standalone "All Logs" view — Craft logs, plugin logs, and PHP error logs together in one place.
- Filter, search, and sort — filter by level, source, and category; search messages/context; sort by timestamp, level, user, category, or message.
- Smart display — adaptive timestamps, automatic hiding of no-variance columns, and expandable JSON context rows.
- Multi-format parsing — understands plugin logs, Craft web/queue/console logs, PHP error logs, and Monolog's bracketed ISO-8601 format.
Built for real log volumes
- Indexed SQLite cache parses each file once, then serves filtered, sorted, paginated pages with low memory use — large log pages stay fast after the first parse.
- Automatic invalidation when a log grows, plus a manual clear under Utilities → Clear Caches.
Control Panel settings
- Set the display name, main-menu visibility, entries-per-page, and timestamp format from the Control Panel.
- Every setting is overridable per environment via
config/logging-library.php.
Hosting-aware
- Detects edge/ephemeral platforms where local files don't persist and hides file-based viewers automatically — with a force-enable override for when you have persistent storage. Servd is verified today; more platforms are added as we test them.
Security & access control
- Log-injection safe — newlines in messages are neutralized automatically (CWE-117), so one log call is always one line, even with attacker-controlled values.
- Validated downloads — log file downloads are permission-gated and validated against path-traversal.
- Granular permissions — separate gates for viewing logs, downloading logs, clearing caches, and managing settings.
Localized interface
The plugin's own Control Panel is fully translated into 12 languages: Arabic, Danish, Dutch, English, French, German, Italian, Japanese, Norwegian, Portuguese, Spanish, and Swedish.
To install this plugin, copy the command above to your terminal.
This plugin doesn't have any reviews.




