Skip to content

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

Notifications You must be signed in to change notification settings

albovieira/logger-dispatcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
  • Elastic

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'
});

Elastic

const logger = factory.create('redis', {
  level: 'verbose',
  clientOpts: {
      node: 'http://localhost:9200'
  }
});

Features

License

License

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages