2.3.0 • Published 6 years ago

winston-nsq-transport v2.3.0

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

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

2.3.0

6 years ago

2.2.0

7 years ago

2.1.0

7 years ago

2.0.0

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

8 years ago

1.1.0

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago