googleapis / nodejs-logging-winston

Node.js client integration between Stackdriver Logging and Winston.
https://cloud.google.com/logging/
Apache License 2.0
105 stars 50 forks source link

How can I set the individual format for transports? #772

Closed anselmo-coolstay closed 1 year ago

anselmo-coolstay commented 1 year ago

My application needs two transports. One is for Cloud Logging and the other is for console. Both transports should have different formats.

According to https://github.com/winstonjs/winston#common-transport-options, Winston support the format for a transport. But, the options for LoggingWinston's constructor seems not to support it.

How can I set them differently?

losalex commented 1 year ago

Thanks @anselmo-coolstay - indeed, this is a feature missing. As a workaround, you could just create multiple loggers with dedicated format by calling winston.createLogger, but I agree it is less convenient.