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); 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 = {};
@ -49,7 +49,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: "BMA_EHR_DEVELOPMENT", systemName: "BMA_EHR_DEVELOPMENT",
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,
method: req.method, method: req.method,