Skip to content

Latest commit

 

History

History
70 lines (54 loc) · 1.4 KB

README.md

File metadata and controls

70 lines (54 loc) · 1.4 KB

Moleculer logo

NPM version NPM Downloads

Moleculer custom logger for Datadog

This is a fork from native Datadog logger

Description

This logger add some options for native Datadog logger

Install

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

Import

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

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

Usage

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

Default options

const defaultOptions = {
  url: "https://http-intake.logs.us5.datadoghq.com/api/v2/logs",
  apiKey: process.env.DATADOG_API_KEY,
  ddSource: "moleculer",
  env: undefined,
  hostname: hostname(),
  objectPrinter: null,
  interval: 10 * 1000,
  excludeModules: [],
}

Options example

{
  "interval": 5000,
  "excludeModules": [
    "broker",
    "registry",
    "discovery",
    "transporter",
    "$node",
    "transit",
    "cacher"
  ]
}