Published

Last Push

Marketplace Rating

Discussion

Readme from Github

gelf-stream

Also provides a stream that can be used directly in
Bunyan and provides
a number of sane mappings.

Example

var split =require('split'),
bunyan =require('bunyan'),
gelfStream =require('gelf-stream')
// gelf-stream comes with Bunyan supportvar stream =gelfStream.forBunyan('localhost')
var log =bunyan.createLogger({name:'foo', streams: [{type:'raw', stream: stream}]})
log.info('Testing Bunyan') // will be sent to the Graylog2 server on localhostlog.error(newError('Oh noes!')) // will extract file/line numbers toostream.end() // Bunyan doesn't currently end the stream when the program has finished// Or you can use it to stream any sort of object/stringprocess.stdin
.pipe(split()) // split into lines
.pipe(gelfStream.create('localhost', {defaults: {level:6}}))
process.stdin.resume()