feat: Logins log for Fail2Ban (#986)

* login logs and output

* fix(merge)

* fix(wiston) unistall

* fix(winston) installation in api

* fix(logger) new module
This commit is contained in:
Marco Beretta 2023-09-24 18:18:10 +02:00 committed by GitHub
parent 7c0379ba51
commit 1bf6c259b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 198 additions and 27 deletions

12
api/utils/logger.js Normal file
View file

@ -0,0 +1,12 @@
const winston = require('winston');
const logger = winston.createLogger({
level: 'info',
format: winston.format.combine(winston.format.timestamp(), winston.format.json()),
transports: [
new winston.transports.Console(),
new winston.transports.File({ filename: 'login-logs.log' }),
],
});
module.exports = logger;