lazywithclass / winston-cloudwatch

Send logs to Amazon Cloudwatch using Winston.
MIT License
260 stars 105 forks source link

Does not log to console by default anymore #161

Open ld-singh opened 3 years ago

ld-singh commented 3 years ago

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 commented 3 years ago

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() ] });

lazywithclass commented 3 years ago

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.