Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A ZeroMQ-Elastic search transport for Winston.
JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
lib
.gitignore
LICENSE
README.md
package.json

README.md

winston-zeromq-elasticsearch

A ZeroMQ-ElasticSearch transport for Winston. Sends the messages to save using a ZeroMQ PUSH socket. The message format is compatible with LogStash.

Installation

Installing winston-zeromq-elasticsearch

 $ npm install winston
 $ npm install winston-zeromq-elasticsearch

Usage

Options

This winston transport takes the following options:

  • socketAddress: The ZeroMQ socket address you want to send to.
  • level: Level of messages that this transport should log. (default 'debug')
  • silent: Boolean flag indicating whether to suppress output. (default false)
  • metadata: Default metadata to be added on each log entry. (default {})

Using the Default Logger

var winston = require('winston');

//
// Requiring `winston-zeromq-elasticsearch` will expose 
// `winston.transports.ZeroMQElasticSearch`
//
require('winston-zeromq-elasticsearch').ZeroMQElasticSearch;

winston.add(winston.transports.ZeroMQElasticSearch,
    { socketAddress: 'tcp://0.0.0.0:9700' });

winston.info('Hello world!');

Using your own Logger

var winston = require('winston');

//
// Requiring `winston-zeromq-elasticsearch` will expose 
// `winston.transports.ZeroMQElasticSearch`
//
require('winston-zeromq-elasticsearch').ZeroMQElasticSearch;

var logger = new winston.Logger ({
  transports : [
    new winston.transports.ZeroMQElasticSearch({
      socketAddress : 'tcp://0.0.0.0:9700'
    })
  ]
});

logger.info('Hello world!');

Environment

You can manage the saved logs using Kibana

Author: Angel Sanchez

License: MIT

Something went wrong with that request. Please try again.