Rodrigo Loza
Rodrigo Loza

Reputation: 1258

Laravel stderr channel logs on Docker don't work

I have a straightforward application with php Laravel with the following channel configured for logs:

'stderr' => [
            'driver' => 'monolog',
            'level' => env('LOG_LEVEL', 'debug'),
            'handler' => StreamHandler::class,
            'formatter' => env('LOG_STDERR_FORMATTER'),
            'with' => [
                'stream' => 'php://stderr',
            ],
        ],

I've made sure the env variables LOG_CHANNEL and LOG_LEVEL are properly configured. Though docker doesn't output anything. Is there anyone that could give me more feedback on how to debug? Thanks so much

Upvotes: 4

Views: 3732

Answers (1)

Gabriel Chenaouy
Gabriel Chenaouy

Reputation: 11

I'm using this and everything is working :

'stderr' => [
            'driver' => 'monolog',
            'level' => env('LOG_LEVEL', 'debug'),
            'handler' => StreamHandler::class,
            'formatter' => env('LOG_STDERR_FORMATTER'),
            'with' => [
                'stream' => 'php://stdout',
                'level' => 'debug',
            ],
        ],

Hope you found your solution !

Upvotes: 0

Related Questions