Commit 9f8f3628 by Sxy

fix: 日志

parent 030e2adb
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
![image](public/images/image-20210801203634043.png) ![image](public/images/image-20210801203634043.png)
#### 全链路日志
![image](public/images/iShot2021-08-04-16.18.40.png)
#### API #### API
> 注: 全链路追踪 请求头 X-Request-Id > 注: 全链路追踪 请求头 X-Request-Id
......
...@@ -6,7 +6,7 @@ import moment from 'moment'; ...@@ -6,7 +6,7 @@ import moment from 'moment';
import path from "path" import path from "path"
const myFormat = format.printf(({ level, message, timestamp, requestId }) => { const myFormat = format.printf(({ level, message, timestamp, requestId }) => {
return `[${moment(timestamp).format("YYYY-MM-DD hh:mm:ss.SSS")}] [${level}] ${requestId ? ("[" + requestId + "] :") : ''} ${message}`; return `[${moment(timestamp).format("YYYY-MM-DD HH:mm:ss.SSS")}] [${level}] ${requestId ? ("[" + requestId + "] :") : ''} ${message}`;
}); });
const requestId = format((info) => { const requestId = format((info) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment