feat: change format
This commit is contained in:
parent
28122752fa
commit
7ab828ab50
1 changed files with 2 additions and 2 deletions
|
|
@ -28,7 +28,7 @@ async function logMiddleware(req: Request, res: Response, next: NextFunction) {
|
||||||
return originalJson.call(this, v);
|
return originalJson.call(this, v);
|
||||||
};
|
};
|
||||||
|
|
||||||
const timestamp = new Date().toString();
|
const timestamp = new Date().toISOString();
|
||||||
const start = performance.now();
|
const start = performance.now();
|
||||||
|
|
||||||
req.app.locals.logData = {};
|
req.app.locals.logData = {};
|
||||||
|
|
@ -46,7 +46,7 @@ async function logMiddleware(req: Request, res: Response, next: NextFunction) {
|
||||||
logType: res.statusCode >= 500 ? "error" : res.statusCode >= 400 ? "warning" : "info",
|
logType: res.statusCode >= 500 ? "error" : res.statusCode >= 400 ? "warning" : "info",
|
||||||
systemName: "JWS-SOS",
|
systemName: "JWS-SOS",
|
||||||
startTimeStamp: timestamp,
|
startTimeStamp: timestamp,
|
||||||
endTimeStamp: new Date().toString(),
|
endTimeStamp: new Date().toISOString(),
|
||||||
processTime: performance.now() - start,
|
processTime: performance.now() - start,
|
||||||
host: req.hostname,
|
host: req.hostname,
|
||||||
sessionId: req.headers["x-session-id"],
|
sessionId: req.headers["x-session-id"],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue