The documentation you are viewing is for an older version of this component.
Switch to the latest (v4) version.
When using dot-log
or laminas-log
, the logged value is not limited to a string. Arrays can be logged as well. For better readability, these arrays can be serialized. Laminas Log provides String, XML, JSON and FirePHP formatting.
The formatter accepts following parameters:
Laminas\Log\Formatter\FormatterInterface
)The following snippet formats the message as JSON data:
'formatter' => [
'name' => \Laminas\Log\Formatter\Json::class,
],