add logger

This commit is contained in:
Emily
2024-09-17 13:38:02 +02:00
parent fd5eca29cc
commit 86011c38ce
6 changed files with 50 additions and 17 deletions

View File

@@ -23,6 +23,7 @@ export const logger = winston.createLogger({
],
transports: [
new winston.transports.Console({
level: 'debug',
format: combine(
winston.format.colorize({ all: true }),
errors({ stack: true }),
@@ -36,6 +37,10 @@ export const logger = winston.createLogger({
})
),
}),
new winston.transports.File({ filename: 'winston-logs.ndjson' })
new winston.transports.File({ filename: 'winston-logs.ndjson' }),
new winston.transports.File({
level: 'debug',
filename: 'winston-debug.ndjson'
})
]
});