在docker logs
中,我仅看到nginx消息,而看不到来自独白的消息
https://i.stack.imgur.com/1iRjV.png
我尝试向stdout流发送一些消息,并在$logger = new \Monolog\Logger('MyTestName');
$handler = new StreamHandler('php://stdout', Logger::DEBUG);
$logger->pushHandler($handler);
$logger->error('My test error message');
中看到它
docker logs
Cannot update during an existing state transition (such as within 'render'). Render methods should be a pure function of props and state
中的将是我的错误消息
答案 0 :(得分:0)
在您的php.ini中,添加以下几行:
log_errors = On
error_log = /dev/stderr
现在您将能够看到任何PHP错误日志:
docker logs -f php_container