在日志文件不可写的情况下,会把完整的异常信息发送至客户端
- Dominant language
- PHP
- Stars
- 2.7k
- Forks
- 251
- PR merge metrics
- No merged PRs in 30d
Description
浏览器显示的异常信息,原因是模拟控制器抛出了未捕获的异常,框架捕获到异常后将异常信息记录到日志中,但是日志文件在不可写的情况下会将所有的异常信息都发送到客户端,想问下这种算正常情况吗。
`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}`


Contributor guide
No contributing guide indexed for this repository
Research direction
Start with vendor/workerman/webman-framework/src/App.php around the exception-handling entries shown in the stack trace, then inspect how logging failures are handled when the runtime log file is not writable. Reproduce the simulated controller exception with the log path unwritable and determine whether the client still receives the exception and stack trace; done means the failure is handled without exposing that information.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100