winston-cloudwatch icon indicating copy to clipboard operation
winston-cloudwatch copied to clipboard

Does not log to console by default anymore

Open ld-singh opened this issue 4 years ago • 2 comments

We have been using winston-cloudwatch version 1.5.0 and recently upgraded to version 3.0.0 It used to logs in console and cloudwatch both. But now it logs all infos in cloudwatch and only errors in console. What can we do to log again in both cloudwatch and console?

winston.add(new WinstonCloudWatch({ logGroupName: 'testing', logStreamName: 'first' }));

ld-singh avatar Sep 20 '21 02:09 ld-singh

Do i need to create like this now with latest version to log in both cloudwatch and console? const logger = winston.createLogger({ transports: [ new WinstonCloudWatch({ logGroupName: 'testing', logStreamName: 'first' }), new winston.transports.Console() ] });

ld-singh avatar Sep 21 '21 06:09 ld-singh

I've added an example that works for the latest version: https://github.com/lazywithclass/winston-cloudwatch/blob/master/examples/simple-with-console.js

Let me know if you still have issues.

lazywithclass avatar Sep 28 '21 17:09 lazywithclass