Logging fix, ignoring some ips in logging, displaying "DIR" insted of 0MB

This commit is contained in:
MrFry 2019-10-24 19:38:01 +02:00
parent 3c52873422
commit f7b0e727fc
3 changed files with 26 additions and 13 deletions

View file

@ -65,6 +65,19 @@ let modules = {
const app = express()
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()
})
Object.keys(modules).forEach(function (k, i) {
let x = modules[k]
try {
@ -132,18 +145,6 @@ function setLogTimer () {
setLogTimer()
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()
})
logger.Log('Node version: ' + process.version)
logger.Log('Listening on port: ' + port)