diff --git a/app.js b/app.js index beb0743b9..d36242e1c 100644 --- a/app.js +++ b/app.js @@ -65,6 +65,12 @@ if (!config.useSSL && config.protocolUseSSL) { // logger app.use(morgan('combined', { + skip: function(req, res) { + // skip logging if specified + // unless the app is running in debug mode + // or throws an error + return req.skipLogging && config.loglevel !== "debug" && res.statusCode < 400 + }, stream: logger.stream })) diff --git a/lib/web/statusRouter.js b/lib/web/statusRouter.js index d939a3fee..c26eb7c03 100644 --- a/lib/web/statusRouter.js +++ b/lib/web/statusRouter.js @@ -14,6 +14,7 @@ const statusRouter = module.exports = Router() // get status statusRouter.get('/status', function (req, res, next) { + req.skipLogging = true realtime.getStatus(function (data) { res.set({ 'Cache-Control': 'private', // only cache by client