Even more logging coloring

This commit is contained in:
MrFry 2019-10-13 10:49:19 +02:00
parent 873d12ef73
commit 6104d2fb4d
3 changed files with 14 additions and 5 deletions

View file

@ -95,9 +95,17 @@ setLogTimer()
const app = express()
const loggableKeywords = [
'user.js'
]
app.use(function (req, res, next) {
res.on('finish', function () {
logger.LogReq(req, true, res.statusCode)
let toLog = loggableKeywords.some((x) => {
return req.url.includes(x)
})
if (toLog) { logger.LogReq(req) }
if (res.statusCode !== 404) { stat.LogStat(req.url) }
})
next()