Uwev2/src/inc/log.mjs
2017-12-04 12:22:53 +01:00

27 lines
670 B
JavaScript

//const winston = require("winston");
import winston from "winston";
const logger = new (winston.Logger)({
transports: [
new (winston.transports.File)({
name: "debug-file",
filename: `./logs/${~~(Date.now() / 1000)}_debug.log`,
level: "debug"
}),
new (winston.transports.File)({
name: "info-file",
filename: `./logs/${~~(Date.now() / 1000)}_info.log`,
level: "info"
}),
new (winston.transports.File)({
name: "error-file",
filename: `./logs/${~~(Date.now() / 1000)}_error.log`,
level: "error"
}),
new (winston.transports.Console)({
level: "info"
})
]
});
export { logger };