Requests Monitor 本文未发布 发布文章

未匹配的标注

Apiato provides a simple and easy way to monitor and log all the HTTP requests coming to your application.
The request monitor can be very useful when testing and debugging your frontend Apps who consumes your API. Especially when the frontend apps (Mobile, Web,..) are built by other developers who are far from you.
The requests monitor is provided by the Debugger Container, by a RequestsMonitorMiddleware middleware.

Enable-requests-logging

From the .env file set REQUESTS_DEBUG to true.

Now in order for this to start displaying the results you need to enable the debugging mode in Laravel by setting APP_DEBUG to true in the .env as well.

Usage

Simply tail the log file

tail -f storage/logs/debugger.log

Result

Screenshot example:

Change the default log file

By default everything is logged in the debugger.log file, to change the default file go to Debugger/Configs/debugger.php config file and set the file name:

<?php

/*

 |--------------------------------------------------------------------------
 | Log File
 |--------------------------------------------------------------------------
 |
 | What to name the log file in the `storage/log` path.
 |
 */

'log_file' => 'debugger.log',

This feature is provided by the Debugger Container via its RequestsMonitorMiddleware middleware.
To see the results go ahead and Tail the default Laravel debug file tail -f storage/logs/laravel.log.
Note: this will also not run in Testing environments, to enable it you need to manually edit the Middleware.

本文章首发在 LearnKu.com 网站上。

上一篇 下一篇
《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
讨论数量: 0
发起讨论 只看当前版本


暂无话题~