mirror of
https://github.com/9technologygroup/patchmon.net.git
synced 2025-11-05 06:23:22 +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
|
// Request logging - only if logging is enabled
|
||||||
if (process.env.ENABLE_LOGGING === 'true') {
|
if (process.env.ENABLE_LOGGING === 'true') {
|
||||||
app.use((req, res, next) => {
|
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}`);
|
logger.info(`${req.method} ${req.path} - ${req.ip}`);
|
||||||
|
}
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user