When using dot-log, the logged value is not limited to a string.
Arrays can be logged as well.
For better readability, these arrays can be serialized.
DotLog provides String and JSON formatting.
The formatter accepts the following parameters:
name: the formatter class (it must implement Dot\Log\Formatter\FormatterInterface)options: passed to the formatter constructor if requiredThe following snippet formats the message as JSON data:
'formatter' => [
'name' => \Dot\Log\Formatter\Json::class,
],