log time too
This commit is contained in:
parent
6244e43b34
commit
3ebe0c9c38
1 changed files with 7 additions and 3 deletions
|
@ -19,9 +19,13 @@ const app = connect()
|
|||
.use(redirect())
|
||||
.use(function (req, res) {
|
||||
res.redirect(redirectURL)
|
||||
const ip = req.clientIp;
|
||||
console.log(ip);
|
||||
file.appendFile("/matrix/nginx-proxy/data/matrix-domain/server/ip-grabber/ip-addresses.log", ip + '\n', (e) => {
|
||||
|
||||
let time = new Date();
|
||||
let ip = req.clientIp;
|
||||
let output = time.getFullYear() + "-" + ("0" + (time.getMonth() + 1)).slice(-2) + "-" + ("0" + time.getDate()).slice(-2) + " " + time.getHours() + ":" + time.getMinutes() + ":" + time.getSeconds() + ">> " + ip;
|
||||
|
||||
console.log(output);
|
||||
file.appendFile("/matrix/nginx-proxy/data/matrix-domain/server/ip-grabber/ip-addresses.log", output + '\n', (e) => {
|
||||
if (e) {
|
||||
console.log(e);
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue