This commit is contained in:
2024-07-26 12:59:11 +05:00
commit b3e6ff5e9c
856 changed files with 30776 additions and 0 deletions
+27
View File
@@ -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",
}),
],
});