amqp-gelf-stream

Creates a stream to work with bunyan to send log messages to an amqp server in gelf format. This is derivative of gelf-stream which provides a direct connection to a Graylog2 server.

npm install amqp-gelf-stream
4 downloads in the last week
9 downloads in the last month

amqp-gelf-stream

Creates a stream to work with bunyan to send log messages to an amqp server in gelf format. This is derivative of gelf-stream which provides a direct connection to a Graylog2 server.

Install

npm install amqp-gelf-stream

Example


var amqpStream = require('amqp-gelf-stream')
  , logger = require('bunyan');

var stream = amqpStream.create('myQueue', { host:'localhost', port:5672 });
var log = new logger({ 
  name: 'myLogger', 
  streams: [
    { 
      type: 'raw', 
      stream: stream, 
      level: 'info' 
    }
  ],
  serializers: {
    req: logger.stdSerializers.req,
    res: logger.stdSerializers.res
  }
});

log.info('hello world');

stream.end();
npm loves you