mirror of
https://github.com/9technologygroup/patchmon.net.git
synced 2025-10-25 09:03:40 +00:00
feat(backend): make requests to health endpoint debug log level
avoids spam in docker
This commit is contained in:
@@ -273,8 +273,13 @@ app.use(express.urlencoded({ extended: true, limit: process.env.JSON_BODY_LIMIT
|
||||
|
||||
// Request logging - only if logging is enabled
|
||||
if (process.env.ENABLE_LOGGING === 'true') {
|
||||
app.use((req, res, next) => {
|
||||
logger.info(`${req.method} ${req.path} - ${req.ip}`);
|
||||
app.use((req, _, next) => {
|
||||
// Log health check requests at debug level to reduce log spam
|
||||
if (req.path === '/health') {
|
||||
logger.debug(`${req.method} ${req.path} - ${req.ip}`);
|
||||
} else {
|
||||
logger.info(`${req.method} ${req.path} - ${req.ip}`);
|
||||
}
|
||||
next();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user