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 网站上。

上一篇 下一篇
《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
讨论数量: 0
发起讨论 只看当前版本


暂无话题~