Skip to content
Stream to work with bunyan to send log messages in gelf format to amqp message queue
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
README.md
amqp-gelf-stream.js
package.json

README.md

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();
Something went wrong with that request. Please try again.