mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Logging fix, ignoring some ips in logging, displaying "DIR" insted of 0MB
This commit is contained in:
parent
3c52873422
commit
f7b0e727fc
3 changed files with 26 additions and 13 deletions
|
@ -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')) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue