status codes
This commit is contained in:
parent
f324587860
commit
f8fcb5a5d4
@ -118,7 +118,7 @@ class Server extends EventEmitter {
|
||||
|
||||
logRequest (req, res, next) {
|
||||
res.once('finish', () => {
|
||||
this.logger[res.statusCode === 401 ? 'unauthorised' : 'access'](`[${req.get('X-Forwarded-For') || req.socket.remoteAddress}] [STATUS: ${res.statusCode}] Request to ${req.route?.path || req.path}`);
|
||||
this.logger[[ 401, 403 ].includes(res.statusCode) ? 'unauthorised' : 'access'](`[${req.get('X-Forwarded-For') || req.socket.remoteAddress}] [STATUS: ${res.statusCode}] Request to ${req.route?.path || req.path}`);
|
||||
});
|
||||
next();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user