winston-cloudwatch-transport

1.0.8 • Public • Published

winston-cloudwatch-transport

This is a rewrite/modification of winston-cloudwatch. This module allows for multiple instances of the cloudwatch transport to be used with Winston.
Allowing you to leverage winston categories for logging to multiple CloudWatch Log Groups/Streams.

Installation

npm install winston winston-cloudwatch-transport

Configuration

By File

AWS configuration works using ~/.aws/credentials as written in AWS JavaScript SDK guide.

By Environment Variables

AWS_ACCESS_KEY_ID = <Your AWS Access key>
AWS_SECRET_KEY = <Your AWS Secret Key>
AWS_REGION = <Region containing your CloudWatch Log Group>

Usage

Options

  • logGroupName
  • logStreamName
  • name - Optional Defaults to "cloudwatch" + logGroupName + logStreamName
  • level - Optional Defaults to debug
  • awsAccessKeyId - Optional if provided by environment variable AWS_ACCESS_KEY_ID or ~/.aws/credentials/
  • awsSecretKey - Optional if provided by environment variable AWS_SECRET_KEY or ~/.aws/credentials/
  • awsRegion - Optional if provided by environment variable AWS_REGION

Example

var winston = require('winston');
 
winston.transports.<Transport Name> = new require('winston-cloudwatch-transport', {
    logGroupName: <Log Group Name>,
    logStreamName: <Log Stream Name>
});

Package Sidebar

Install

npm i winston-cloudwatch-transport

Weekly Downloads

29

Version

1.0.8

License

MIT

Last publish

Collaborators

  • andrewperet
  • npanone