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

@ -41,6 +41,11 @@ const colors = [
'cyan'
]
let noLogips = utils.ReadFile('./nolog').split('\n')
setInterval(() => {
noLogips = utils.ReadFile('./nolog').split('\n')
}, 1000 * 60 * 30)
function GetDateString () {
const m = new Date()
const d = m.getFullYear() + '/' +
@ -64,6 +69,13 @@ function LogReq (req, toFile, sc) {
try {
let ip = req.headers['cf-connecting-ip'] || req.connection.remoteAddress
let nolog = noLogips.some((x) => {
return x.includes(ip)
})
if (nolog) {
return
}
let logEntry = GetRandomColor(ip) + ip + C()
let dl = DELIM
if (req.url.includes('lred')) {