Skip to content

Commit f00f451

Browse files
committed
feat(morgan): changed for getting api hitting count and time for monitoring
1 parent 41c7e05 commit f00f451

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

services/auth-service/src/config/morgan.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ export const morganMiddleware = morgan((tokens, req, res) => {
1212
status,
1313
responseTime,
1414
contentLength: tokens.res(req, res, 'content-length') || 0,
15-
slow: responseTime > 1000,
16-
error: status >= 500,
15+
slow: responseTime > 1000,
16+
error: status >= 500,
1717
};
1818

1919
if (status >= 500) {
20-
logger.error(logData);
20+
logger.error(logData);
2121
} else if (responseTime > 1000) {
22-
logger.warn(logData);
22+
logger.warn(logData);
2323
} else {
24-
logger.info(logData);
24+
logger.info(logData);
2525
}
2626

2727
return null;
28-
});
28+
});

0 commit comments

Comments
 (0)