Skip to content
This repository has been archived by the owner on May 19, 2021. It is now read-only.

Winston NSQ transport. Uses official NSQ client library (nsqjs).

License

Notifications You must be signed in to change notification settings

ofkindness/winston-nsq-transport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

winston-nsq-transport

CircleCI NPM version Dependency Status NPM Downloads

Winston NSQ transport. Uses official NSQ client library nsqjs.

Installation

  $ npm install winston
  $ npm install winston-nsq-transport

Options

  • level: The winston's log level, default: "info"
  • nsqdHost: A string representing the host of nsqd instance.
  • nsqdPort: A string representing the port of nsqd instance.
  • nsqOptions: An object representing the nsqjs writer options
  • topic: A string representing NSQ topic.

See the default values used:

const options = {
  level: 'info',
  nsqdHost: '127.0.0.1',
  nsqdPort: '4150',
  nsqOptions: {
    clientId: 'winston-nsq-transport'
  },
  topic: 'winston_logs'
};

Usage

const { Logger } = require('winston');
const NSQTransport = require('winston-nsq-transport');

const logger = new Logger({
  transports: [
    new NSQTransport({
      topic: 'winston_logs',
      nsqdHost,
      nsqdPort
    })
  ]
});

module.exports = logger;

Logging

logger.log('info', 'message', {});

Run Tests

The tests are written in vows, and designed to be run with npm.

  $ npm test

LICENSE

MIT License

About

Winston NSQ transport. Uses official NSQ client library (nsqjs).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published