2
I have a problem in Winston, follow my settings:
const logger = winston.createLogger({
level: 'info',
format: winston.format.json(),
transport: [
new winston.transports.File({ filename: './../error.log', level: 'error', json: true }),
new winston.transports.File({ filename: './../info.log', json: true }),
new winston.transports.Console()
]
});
Here’s the piece of code I request to log:
.catch(err => logger.error({
message: 'Erro ao cadastrar usuário',
data: err
}));
Here is the alert that appears in the attempt to generate the log:
NOTE: I am only sending the beginning of the message that appears because it is a bit big because of json
[winston] Attempt to write logs with no transports {"message":"Erro ao cadastrar usuário","data":{"name":
This is my problem, in trying to generate the log it returns me this.
I will test here, if it works mark as right hheheehe. If it works was a fucking wobble ahuaha
– Pedro Soares