linkfast / exengine-monolog
Monolog logger extension for the ExEngine microframework.
Package info
gitlab.com/linkfast/oss/exengine-extensions/exengine-monolog
Type:exengine-extension
pkg:composer/linkfast/exengine-monolog
Requires
- php: >=8.1.0
- linkfast/exengine: ^1.3
- monolog/monolog: ^2.9 || ^3.0
Requires (Dev)
- phpunit/phpunit: ^13.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-10-11 17:45:43 UTC
README
Uses Monolog as the logger of the ExEngine microframework.
© LinkFast S.A. (https://linkfast.io) · MIT License
Requirements
- PHP 8.1 or higher
- ExEngine 1.3 or higher
- Monolog 2.9 or 3.x (installed automatically)
Installation
With the ExEngine CLI (exen, in development):
exen extension:add linkfast/exengine-monolog
Or with Composer:
composer require linkfast/exengine-monolog
ExEngine discovers the extension automatically (Composer package type exengine-extension); there is nothing to
register. With logging enabled (const EXENGINE_LOG = true; in your launcher), every ExEngine logger writes
through Monolog, and the logger name becomes the Monolog channel (ExEngine.router, Orders.Payments, ...).
Configuration
In config/application.yml (or any profile file):
monolog:
enabled: true # false keeps the logger configured in ExEngine
stream: php://stderr # file path or stream URL
level: debug # debug, info, notice, warning, error, critical, alert, emergency
| Key | Default | Description |
|---|---|---|
monolog.enabled | true | Make Monolog the ExEngine logger |
monolog.stream | php://stderr | File path or stream URL the logs are written to |
monolog.level | debug | Minimum level written |
Environment variables override these keys as usual (MONOLOG_LEVEL=warning,
MONOLOG_STREAM=/var/log/app.log). Setting exengine.logger still takes precedence over the extension.
With RoadRunner, php://stderr ends up in the RoadRunner log.
Handlers and processors
Use the shared Monolog instance to add your own handlers or processors, for example in a Booted listener:
use ExEngine\Monolog\MonologLogger;
use Monolog\Processor\UidProcessor;
MonologLogger::monolog()->pushProcessor(new UidProcessor());
Upgrading from ExEngine 1.2
ExEngine 1.2 shipped ExEngine\Logger\MonoLogger in its core. It now lives in this package, which keeps that
class name working as an alias: install the package and existing configurations keep logging. The
EXENGINE\LOG_LOCATION constant is still honoured (warning level) until the monolog properties are set.
Development
Tests need PHP 8.4+ (PHPUnit 13):
composer install
php vendor/bin/phpunit
To test against a local checkout of the ExEngine core (for example before a core release), point Composer to it without committing the change:
composer config repositories.exengine '{"type": "path", "url": "../../exengine", "options": {"versions": {"linkfast/exengine": "1.3.0"}}}'
composer update linkfast/exengine
The CI does the same with the core branch or tag in the EXENGINE_REF variable (default master); leave it
empty to test against the core published on Packagist.
Releasing
- Update
CHANGELOG.md. - Create an annotated tag on
main, without a "v" prefix like the ExEngine core:git tag -a 1.0.0 -m "..." && git push origin 1.0.0. - Packagist publishes the tag (register the repository once at https://packagist.org/packages/submit and enable the GitLab integration so new tags are picked up automatically).
License
MIT, see LICENSE.