logger-dispatcher

This is an abstraction for winston logger, with this package we can just inform the transporter and it will provide a winston instance configured

Usage no npm install needed!

<script type="module">
  import loggerDispatcher from 'https://cdn.skypack.dev/logger-dispatcher';
</script>

README

Logger Dispatcher npm version

An abstraction for winston logger, with this package we can just inform the transporter and it will provide a winston instance configured

It suports

  • Console
  • Redis
  • Firehose

Build Status Dependency Status Coverage Status Code Climate

Sumary


Installation

$ npm install logger-dispatcher

Usage

Local

/** logger is an instance of winston with local console as a transporter **/
const logger = factory.create('console', {
  level: 'verbose'
});

Firehose

/** logger is an instance of winston with firehose as a transporter **/
const logger = factory.create('console', {
  level: 'debug',
  name: 'container-name',
  region: 'us-east-1',
  accessKeyId: 'AWS_KEY',
  secretAccessKey: 'AWS_SECRET'
});

Redis

/** logger is an instance of winston with redis as a transporter **/
const logger = factory.create('redis', {
  level: 'verbose',
  container: 'container-name',
  environment: 'homologation',
  host: 'redis-host.com.br',
  port: '6379'
});

Features

License

License