Socket
Socket
Sign inDemoInstall

winston-aws-cloudwatch

Package Overview
Dependencies
5
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    winston-aws-cloudwatch

A Winston transport for Amazon CloudWatch.


Version published
Weekly downloads
11K
decreased by-0.01%
Maintainers
1
Install size
56.6 MB
Created
Weekly downloads
 

Readme

Source

winston-aws-cloudwatch

npm Dependencies Build Status Coverage Status JavaScript Standard Style

A Winston transport for Amazon CloudWatch.

Usage

const winston = require('winston')
const CloudWatchTransport = require('winston-aws-cloudwatch')

const logger = winston.createLogger({
  transports: [
    new CloudWatchTransport({
      logGroupName: '...', // REQUIRED
      logStreamName: '...', // REQUIRED
      createLogGroup: true,
      createLogStream: true,
      submissionInterval: 2000,
      submissionRetryCount: 1,
      batchSize: 20,
      awsConfig: {
        accessKeyId: '...',
        secretAccessKey: '...',
        region: '...'
      },
      formatLog: item =>
        `${item.level}: ${item.message} ${JSON.stringify(item.meta)}`
    })
  ]
})

Error Handling

If, for any reason, logging to CloudWatch should fail, then the transport will emit an error event. It is recommended that you subscribe to this event to avoid crashes.

But Why?

As you may have noticed, there is also winston-cloudwatch, which predates this module. After making some contributions to that one, I felt like writing my own version. Feel free to use whichever you like best.

Author

Tim De Pauw

License

MIT

Keywords

FAQs

Last updated on 15 Aug 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc