koa2-温斯顿 koa2版本的winston记录器,例如 3行将记录器添加到您的koa2服务器 用法 安装 npm i --save koa2-winston 快速开始 const { logger } = require ( 'koa2-winston' ) ; app . use ( logger ( ) ) ; 请求日志看起来像 { " req " : { " header " : { " host " : " localhost:3000 " , " connection " : " keep-alive " , " upgrade-insecure-requests " : " 1 " , " user-agent " : " Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 " , " accept "