How to add colors only in console and not in file transport?
const logger = createLogger({
format: combine(
timestamp(),
prettyPrint(),
myFormat
),
transports: [
new transports.Console(),
new DailyRotateFile({
filename: path.resolve(logsDir, 'application-%DATE%.log'),
datePattern: 'YYYY-MM-DD',
zippedArchive: true,
maxSize: '20m'
})
]
})
It seems the option colorize: true doesn't works:
new transports.Console({colorize: true})
Yes, that option was removed in [email protected] in favor of the formats.colorize(). I added an example showing what you need to do in 391aa2b
Thanks @indexzero
It works now!
Most helpful comment
Yes, that option was removed in
[email protected]in favor of theformats.colorize(). I added an example showing what you need to do in 391aa2b