[develop | DONE | CHANGED ] Cache: update accesslogCustomFormat

This commit is contained in:
argirok 2024-07-19 12:37:23 +03:00
parent 40830c48df
commit 7ec3df2dc3
1 changed files with 11 additions and 8 deletions

View File

@ -216,15 +216,18 @@ function resetAtMidnight() {
}, msToMidnight);
}
function accesslogCustomFormat(req, res){
accesslog(req, res,
/*{
userID: function (req) { return req.user; },
format : 'url=":url" method=":method" statusCode=":statusCode" delta=":delta" ip=":ip"'
}*/);
// url="/clear" method="GET" statusCode="200" delta="2" ip="::ffff:195.134.66.178"
// default format
accesslog(req, res);
// ::ffff:195.134.66.178 - - [15/Jul/2024:11:24:35 +0300] "GET /clear HTTP/1.1" 200 59 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/113.0"
//custom format
/*
accesslog(req, res,
{
userID: function (req) { return req.user; },
format : 'url=":url" method=":method" statusCode=":statusCode" delta=":delta" ip=":ip"'
});
*/
// url="/clear" method="GET" statusCode="200" delta="2" ip="::ffff:195.134.66.178"
}