mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Logging data editor module reuqests
This commit is contained in:
parent
592ecfda79
commit
10ccd876d4
3 changed files with 9 additions and 2 deletions
|
@ -1 +1 @@
|
||||||
Subproject commit 9e92b5d5874ab41989f2032dc1760a5cda8adbb5
|
Subproject commit 30c1fb3f3598d0f6dbbe56d335bac71af4b05d10
|
|
@ -1 +1 @@
|
||||||
Subproject commit aaf4f82ec41b345842c6ea29a84a28b8329e6a0c
|
Subproject commit 3e7178f693c00e7db703727017c9bd0427213f80
|
|
@ -72,9 +72,16 @@ app.use(function (req, res, next) {
|
||||||
}
|
}
|
||||||
let ip = req.headers['cf-connecting-ip'] || req.connection.remoteAddress
|
let ip = req.headers['cf-connecting-ip'] || req.connection.remoteAddress
|
||||||
logger.LogReq(req, true, res.statusCode)
|
logger.LogReq(req, true, res.statusCode)
|
||||||
|
|
||||||
let toLog = loggableKeywords.some((x) => {
|
let toLog = loggableKeywords.some((x) => {
|
||||||
return req.url.includes(x)
|
return req.url.includes(x)
|
||||||
})
|
})
|
||||||
|
const hostname = req.hostname.replace('www.', '').split('.')[0]
|
||||||
|
|
||||||
|
if (hostname.includes('dataeditor')) {
|
||||||
|
toLog = true
|
||||||
|
}
|
||||||
|
|
||||||
if (toLog) { logger.LogReq(req) }
|
if (toLog) { logger.LogReq(req) }
|
||||||
if (res.statusCode !== 404) { logger.LogStat(req.url, ip) }
|
if (res.statusCode !== 404) { logger.LogStat(req.url, ip) }
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue