将不同的格式化程序添加到Winston传输
我需要为每个传输不同types的格式化程序。
例
logger = new (winston.Logger)({ transports: [ new (winston.transports.LogstashUDP)({ // some config here. Do noting on formatting }), new (winston.transports.Mail)({ // do formatting one way }), new (winston.transports.File)({ // write to file as json (maybe format it here) }), new (winston.transports.Console)({ // do another formatting }) ] });
正如我从winston传输文档只能看到控制台支持自定义格式化程序。
我使用winston-logstash-upd
winston-mailer
模块来发送邮件和winston-logstash-upd
温斯顿有什么办法解决这个问题吗? 或者,也许如何创build这些模块之一的包装来支持格式?