Skip to content

Latest commit

 

History

History
71 lines (55 loc) · 1.41 KB

README.md

File metadata and controls

71 lines (55 loc) · 1.41 KB

Moleculer logo

NPM version NPM Downloads

Send logs to AWS CloudWatch

This is a fork from native Datadog logger

Description

Easy to send logs directly to AWS CloudWatch

Install

$ npm install @1xtr/moleculer-cloudwatch-logger --save

Import

// ES5 example
const CloudWatchLogger = require('@1xtr/moleculer-cloudwatch-logger');

// ES6+ example
import { CloudWatchLogger } from '@1xtr/moleculer-cloudwatch-logger';

Usage

module.exports = {
  logger: new CloudWatchLogger({
    // put here your options
  })
}

Default options

const defaultOptions = {
  clientOptions: {},
  source: process.env.MOL_NODE_NAME || 'moleculer',
  hostname: hostname(),
  objectPrinter: null,
  interval: 5 * 1000,
  excludeModules: [],
  logGroupName: `mol-${process.env.MOL_NODE_NAME || hostname()}`,
}

Options example

{
  "clientOptions": {
    "region": "us-east-1"
  },
  "excludeModules": [
    "broker",
    "registry",
    "discovery",
    "transporter",
    "$node",
    "transit",
    "cacher"
  ]
}