winston.format.timestamp(),
winston.format.prettyPrint(),
winston.format.printf(
msg => `[${msg.timestamp}] --> (${msg.level}), Message: ${msg.message}`
)
),
transports: [
new winston.transports.File({
filename: "logfile.log"
}),
new winston.transports.MongoDB({
db: "mongodb://127.0.0.1:27017/shopping",
format: winston.format.json(),
level:'error'
})
]
});
level:'error' or format must be inside transports or not?
I have level: "info" as well. Which one is true?
You can specify a different log level for each transport, but you don't have to
Обсуждают сегодня