Skip to content

1xtr/moleculer-datadog-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Moleculer custom logger for Datadog

Resources

License

Stars

Watchers

Forks

Packages

No packages published