upd
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import * as winston from "winston";
|
||||
|
||||
const { combine, timestamp, json } = winston.format;
|
||||
|
||||
export const logger = winston.createLogger({
|
||||
level: "info",
|
||||
format: combine(
|
||||
timestamp({
|
||||
format: "YYYY-MM-DD hh:mm:ss.SSS A",
|
||||
}),
|
||||
json()
|
||||
),
|
||||
transports: [
|
||||
//
|
||||
// - Write to all logs with level `debug` and below to `all.log`
|
||||
// - Write all logs error (and below) to `error.log`.
|
||||
//
|
||||
new winston.transports.File({
|
||||
filename: "logs/error.log",
|
||||
level: "error",
|
||||
}),
|
||||
new winston.transports.File({
|
||||
filename: "logs/all.log",
|
||||
level: "debug",
|
||||
}),
|
||||
],
|
||||
});
|
||||
Reference in New Issue
Block a user