cognesy / logging
Functional logging pipeline for Instructor PHP with framework integrations
v2.9.5
2026-08-30 01:03 UTC
Requires
- php: ^8.3
- cognesy/instructor-config: ^2.9
- cognesy/instructor-events: ^2.9
- psr/log: ^3.0
Requires (Dev)
- icanhazstring/composer-unused: ^0.9.0
- illuminate/contracts: ^11.0
- illuminate/support: ^11.0
- jetbrains/phpstorm-attributes: ^1.2
- maglnet/composer-require-checker: ^4.16
- monolog/monolog: ^3.0
- pestphp/pest: ^4.0
- phpstan/phpstan: ^1.11
- roave/security-advisories: dev-latest
- symfony/dependency-injection: ^7.0
- symfony/event-dispatcher: ^7.0
- symfony/http-kernel: ^7.0
- vimeo/psalm: ^6.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- v2.9.5
- v2.9.4
- v2.9.3
- v2.9.2
- v2.9.1
- v2.9.0
- v2.8.5
- v2.8.4
- v2.8.3
- v2.8.2
- v2.8.1
- v2.8.0
- v2.7.1
- v2.7.0
- v2.6.2
- v2.6.1
- v2.6.0
- v2.5.2
- v2.5.1
- v2.5.0
- v2.4.1
- v2.3.1
- v2.3.0
- v2.2.0
- v2.1.0
- v2.0.0
- v1.22.0
- v1.21.0
- v1.20.0
- v1.19.0
- v1.18.4
- v1.18.3
- v1.18.2
- v1.18.1
- v1.18.0
- v1.17.0
- v1.16.0
- v1.15.0
- v1.14.0
- v1.13.0
This package is auto-updated.
Last update: 2026-08-30 02:04:37 UTC
README
Functional logging pipeline for InstructorPHP events.
Use it to turn events into structured log entries using composable:
- filters
- enrichers
- formatters
- writers
Symfony integration is included.
Framework integration wiring is explicit in 2.0:
- Laravel integration lives in
packages/laravel. - Symfony legacy bundle wiring uses
instructor_logging.event_bus_service(defaultCognesy\Events\Contracts\CanHandleEvents). - The legacy Symfony bundle path is deprecated in favor of
cognesy/instructor-symfonyandinstructor.logging.
Example
<?php use Cognesy\Events\Event; use Cognesy\Logging\Enrichers\BaseEnricher; use Cognesy\Logging\Filters\LogLevelFilter; use Cognesy\Logging\Formatters\DefaultFormatter; use Cognesy\Logging\LogEntry; use Cognesy\Logging\Pipeline\LoggingPipeline; use Cognesy\Logging\Writers\CallableWriter; use Psr\Log\LogLevel; $pipeline = LoggingPipeline::create() ->filter(new LogLevelFilter(LogLevel::INFO)) ->enrich(new BaseEnricher()) ->format(new DefaultFormatter()) ->write(CallableWriter::create(function (LogEntry $entry): void { error_log($entry->message); })) ->build(); $pipeline(new Event(['operation' => 'demo']));
Documentation
packages/logging/CHEATSHEET.mdpackages/logging/src/packages/logging/tests/