mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Even more logging coloring
This commit is contained in:
parent
873d12ef73
commit
6104d2fb4d
3 changed files with 14 additions and 5 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue