I’m running cakephp(4.0) with docker. how can I output cakephp logs to standard output?
I made the following changes to app.php, but the docker logs {container name}
command does not show any logs.
- Docker version 19.03.12
- php-fpm
- nginx
- php 7.4
- CakePHP 4.0.4
config/app.php
use Cake\Console\ConsoleOutput;
use Cake\Log\Engine\ConsoleLog;
'Log' => [
'debug' => [
'className' => ConsoleLog::class,
'stream' => 'php://stdout',
'outputAs' => ConsoleOutput::PLAIN,
// 'url' => env('LOG_DEBUG_URL', null),
'scopes' => false,
'levels' => ['notice', 'info', 'debug'],
],
'error' => [
'className' => ConsoleLog::class,
'stream' => 'php://stderr',
'outputAs' => ConsoleOutput::PLAIN,
// 'url' => env('LOG_ERROR_URL', null),
'scopes' => false,
'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'],
],
// To enable this dedicated query log, you need set your datasource's log flag to true
'queries' => [
'className' => ConsoleLog::class,
'stream' => 'php://stdout',
'outputAs' => ConsoleOutput::PLAIN,
// 'url' => env('LOG_QUERIES_URL', null),
'scopes' => ['queriesLog'],
],
],
I’ve also tried changing php-fpm options setting “catch_workers_output”, but it doesn’t work.
fpm/pool.d/www.conf
catch_workers_output = yes