Menu


Commands


EventBus


Other Packages

Papertrail

Installing Papertrail Logger Laravel

Release Downloads

Installing the Papertrail package is a simple way to log which domain events your system is generating.

Requires

  • SmoothPHP Event Sourcing CQRS Laravel Adapter

Install

Via Composer

$ composer require smoothphp/laravel-papertrail-event-bus-logger

Config

Add the following to config/services.php config file and fill in your port and host provided by PaperTrail

'papertrail' => [
    'host' => '',
    'port' => 1,
    'name' => 'Acme',
]

Hook into Event Bus

You can then add Papertrail into the event bus listeners. When a event is raised it will also push the event to the papertrail logger

 \SmoothPhp\LaravelPapertrailEventBusLogger\PapertrailEventLogger::class,

to config/cqrses.php in the event_bus_listeners array element

Example
'event_bus_listeners'   => [
    \SmoothPhp\LaravelAdapter\StrongConsistency\PushEventThroughQueueWithCommandId::class,
    \SmoothPhp\LaravelPapertrailEventBusLogger\PapertrailEventLogger::class,
],