首页 > 解决方案 > 在终端中禁用请求日志

问题描述

是否可以关闭帆请求日志。就像我试图看不到下面粘贴的示例一样。因为当我运行集成测试时,这些日志会妨碍报告。

<- PUT /api/v1/entrance/login                 (361ms 200)
 |  The requesting user agent has been successfully logged in.
 |  
 |  Under the covers, this stores the id of the logged-in user in the session as the `userId` key.  The next time this user agent sends a request, assuming it includes a cookie (like a web browser), Sails will automatically make this user id available as req.session.userId in the corresponding action.  (Also note that, thanks to the included "custom" hook, when a relevant request is received from a logged-in user, that user's entire record from the database will be fetched and exposed as `req.me`.)
 |  
 ° 
<- GET /api/v1/user/me/overview/subscribe     (26ms 200)

标签: sails.js

解决方案


是帆钩。 https://www.npmjs.com/package/sails-hook-apianalytics

阅读文档,你可以编辑日志或禁用其中的一些,或者只是卸载钩子。

在项目的根目录上运行npm uninstall sails-hook-apianalytics,然后升起风帆。


推荐阅读