Documentation

Formatter

Converts incoming Commands into log messages.

Each method is written for a particular command path. A formatter class should take the given command, format it to a message and pass it to the given logger (with the desired log level).

For an example of what this all looks like, take a look at the ClassNameFormatter example bundled with this package.

A formatter may also use PSR-3 log contexts to pass extra info to the logger about the commands, return values and errors it receives. For more information about log contexts, see the PSR-3 specification.

Tags
see
https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md#13-context

Table of Contents

logCommandFailed()  : void
logCommandReceived()  : void
logCommandSucceeded()  : void

Methods

logCommandFailed()

public logCommandFailed(LoggerInterface $logger, object $command, Exception $e) : void
Parameters
$logger : LoggerInterface
$command : object
$e : Exception
Return values
void

logCommandSucceeded()

public logCommandSucceeded(LoggerInterface $logger, object $command, mixed $returnValue) : void
Parameters
$logger : LoggerInterface
$command : object
$returnValue : mixed
Return values
void

Search results