New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

cloudwatch-transport

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloudwatch-transport

Cloudwatch transport for winston logger

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

Winston Cloudwatch Transport

Amazon Cloudwatch Transporter logs for Winston

Features

  • Tries very hard to deliver messages, even in case of errors
  • Does not fail or break when losing internet connection
  • Follows AWS strict logging rules
  • Truncates long messages (handling UTF-8 characters correctly)
  • Passes actual log timestamps to CloudWatch
  • Cleans up resources when Winston closes the Transport
  • Auto-creates log group and stream
  • Lightweight AWS requester

Usage

import { createLogger } from 'winston';
import CloudWatchTransport from 'winston-cloudwatch-transport';

const Logger = createLogger({
  ...,
  transports: [
    new CloudwatchTransport({
      logGroupName: 'log-group-name',
      logStreamName: 'log-stream-name',
      awsCredentials: {
        accessKeyId: 'aws-access-key',
        secretAccessKey: 'aws-access-key',
        region: 'aws-region',
      },
      enabled: String(process.env.NODE_ENV) === 'dev', // example
    })
  ]
});

Options

{
  awsCredentials: { // required
    accessKeyId: '',
    secretAccessKey: '',
    region: '',
  },

  logGroupName: '', // required
  logStreamName: '', // required

  // Should send logs to CloudWatch. Default set to true
  enabled: boolean

  // Would like to set to true if we are using serverless function to avoid request being shutdown. Default set to false
  async: boolean

  // Customize log message
  formatLog: function
}

Keywords

cloudwatch

FAQs

Package last updated on 01 Nov 2024

Did you know?

Socket

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