@1xtr/moleculer-datadog-logger

1.0.2 • Public • Published

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"
  ]
}

Package Sidebar

Install

npm i @1xtr/moleculer-datadog-logger

Weekly Downloads

2

Version

1.0.2

License

Apache-2.0

Unpacked Size

26.1 kB

Total Files

6

Last publish

Collaborators

  • 1xtr