mix-php / mix

☄️ PHP CLI mode development framework, supports Swoole, WorkerMan, FPM, CLI-Server / PHP 命令行模式开发框架,支持 Swoole、Swow、WorkerMan、FPM、CLI-Server
https://openmix.org/mix-php
Apache License 2.0
1.94k stars 212 forks source link

解决报错:WARNING A possible infinite logging loop was detected and abort… #125

Closed quhaowk closed 1 year ago

quhaowk commented 1 year ago

…ed. It appears some of your handler code is triggering logging, see the previous log record for a hint as to what may be the cause.

onanying commented 1 year ago

出处:https://php.libhunt.com/monolog-latest-version https://github.com/Seldaek/monolog/pull/1681

Previous changes from v3.1.0
Added $datetime parameter to Logger::addRecord as low level API to allow logging into the past or future (#1682)
Added Logger::useLoggingLoopDetection to allow disabling cyclic logging detection in concurrent frameworks (#1681)
Fixed handling of fatal errors if callPrevious is disabled in ErrorHandler (#1670)
Fixed interop issue by removing the need for a return type in ProcessorInterface (#1680)
Marked the reusable Monolog\Test\TestCase class as @internal to make sure PHPStorm does not show it above PHPUnit, you may still use it to test your own handlers/etc though (#1677)
Fixed RotatingFileHandler issue when the date format contained slashes (#1671)
onanying commented 1 year ago

@quhaowk 感觉加到对应的 bin 目录下 swoole.php swooleco.php swoolecopool.php swow.php 更加合适,可以改一下么?

就加一行,加到 Error::register(); 下面

Logger::instance()->useLoggingLoopDetection(false);