Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在日志文件不可写的情况下,会把完整的异常信息发送至客户端 #365

Open
imlinfly opened this issue Mar 31, 2023 · 1 comment

Comments

@imlinfly
Copy link

浏览器显示的异常信息,原因是模拟控制器抛出了未捕获的异常,框架捕获到异常后将异常信息记录到日志中,但是日志文件在不可写的情况下会将所有的异常信息都发送到客户端,想问下这种算正常情况吗。

The stream or file "F:\webman\runtime/logs/webman-2023-03-31.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: 127.0.0.1 GET 127.0.0.1:8787/shared/17d2AgYCBgIGAgYCBlQD Exception: 来自控制器的异常 in F:\webman\app\controller\api\CountController.php:205 Stack trace: #0 F:\webman\vendor\workerman\webman-framework\src\App.php(321): app\controller\api\CountController->shared() #1 F:\webman\vendor\workerman\webman-framework\src\App.php(353): Webman\App::Webman\{closure}() #2 F:\webman\app\common\middleware\admin\AdminLogMiddleware.php(41): Webman\App::Webman\{closure}() #3 F:\webman\vendor\workerman\webman-framework\src\App.php(343): app\common\middleware\admin\AdminLogMiddleware->process() #4 F:\webman\app\common\middleware\CrossDomainMiddleware.php(44): Webman\App::Webman\{closure}() #5 F:\webman\vendor\workerman\webman-framework\src\App.php(343): app\common\middleware\CrossDomainMiddleware->process() #6 F:\webman\vendor\workerman\webman-framework\src\App.php(562): Webman\App::Webman\{closure}() #7 F:\webman\vendor\workerman\webman-framework\src\App.php(148): Webman\App::findRoute() #8 F:\webman\vendor\workerman\workerman\Connection\TcpConnection.php(646): Webman\App->onMessage() #9 F:\webman\vendor\workerman\workerman\Events\Select.php(311): Workerman\Connection\TcpConnection->baseRead() #10 F:\webman\vendor\workerman\workerman\Worker.php(1479): Workerman\Events\Select->loop() #11 F:\webman\vendor\workerman\workerman\Worker.php(1399): Workerman\Worker::forkWorkersForWindows() #12 F:\webman\vendor\workerman\workerman\Worker.php(560): Workerman\Worker::forkWorkers() #13 F:\webman\vendor\workerman\webman-framework\src\support\App.php(131): Workerman\Worker::runAll() #14 F:\webman\start.php(4): support\App::run() #15 {main}

image
image

@aiden66535
Copy link

你需要自定义一下异常拦截,在自定义异常里捕获错误
图片
图片
图片

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants