Configure and setup JSON formatting for monolog
The example below is for Laravel, change as appropriate for your needs
In the config/logging.php
file, tap
the UseJsonFormatting::class
on the logging channel you want, as shown below.
'stdout' => [
'driver' => 'monolog',
'handler' => StreamHandler::class,
'with' => [
'stream' => 'php://stdout',
],
'tap' => [\Jobilla\CloudNative\Monolog\UseJsonFormatting::class],
],