log to stdout / stderr with Laravel 5.6 and php-fpm

This is fixed in PHP 7.3. The config directive for the pool is decorate_workers_output = no as documented in the pull request.


With Monolog in general, if you want to keep for instance DEBUG to INFO messages in STDOUT and higher levels to STDERR, you could do something like this.

$log->pushHandler(
    new \Monolog\Handler\FilterHandler(
        new \Monolog\Handler\StreamHandler('php://stdout'),
            \Monolog\Logger::DEBUG,
            \Monolog\Logger::NOTICE
    )
);

$log->pushHandler(
    new \Monolog\Handler\FilterHandler(
        new \Monolog\Handler\StreamHandler('php://stderr'),
            \Monolog\Logger::WARNING,
            \Monolog\Logger::EMERGENCY
    )
);