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
|
@ -72,9 +72,16 @@ app.use(function (req, res, next) {
|
|||
}
|
||||
let ip = req.headers['cf-connecting-ip'] || req.connection.remoteAddress
|
||||
logger.LogReq(req, true, res.statusCode)
|
||||
|
||||
let toLog = loggableKeywords.some((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 (res.statusCode !== 404) { logger.LogStat(req.url, ip) }
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue