fix: log data type

This commit is contained in:
Methapon2001 2024-07-11 11:05:29 +07:00
parent 21d70dd3f5
commit a6c1df903c

View file

@ -31,7 +31,7 @@ async function logMiddleware(req: Request, res: Response, next: NextFunction) {
return originalJson.call(this, v);
};
const timestamp = new Date().toString();
const timestamp = new Date().toISOString();
const start = performance.now();
req.app.locals.logData = {};
@ -49,7 +49,7 @@ async function logMiddleware(req: Request, res: Response, next: NextFunction) {
logType: res.statusCode >= 500 ? "error" : res.statusCode >= 400 ? "warning" : "info",
systemName: "BMA_EHR_DEVELOPMENT",
startTimeStamp: timestamp,
endTimeStamp: new Date().toString(),
endTimeStamp: new Date().toISOString(),
processTime: performance.now() - start,
host: req.hostname,
method: req.method,