Skip to content

Latest commit

 

History

History
20 lines (16 loc) · 507 Bytes

README.md

File metadata and controls

20 lines (16 loc) · 507 Bytes

monolog-json-logging

Configure and setup JSON formatting for monolog

Usage

The example below is for Laravel, change as appropriate for your needs

Laravel

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],
],