Skip to content
Create and send GELF (Graylog2) messages in node.js, including chunking
Find file
Latest commit bb1e787 Jul 19, 2015 @mhart 0.3.0
Failed to load latest commit information.
.eslintrc Update eslint style Jul 19, 2015
.gitignore Basic package structure Jun 18, 2012
LICENSE.txt Move to full JavaScript Jan 17, 2013 Don't keepAlive by default, add an option for it Jan 18, 2013
example.js Update eslint style Jul 19, 2015

GELF (Graylog2) messages in node.js

Includes chunked messages, so messages can be any size (couldn't find another node.js lib that does this)

var gelfling = require('gelfling')

var client = gelfling()

client.send('Message', function(err) { console.log('Sent') })

client.send({ short_message: 'Message', facility: 'myApp', level: gelfling.INFO })

var complexClient = gelfling('localhost', 12201, {
  defaults: {
    facility: 'myApp',
    level: gelfling.INFO,
    short_message: function(msg) { var txt = msg.txt; delete msg.txt; return txt }
    myAvg: function(msg) { return msg.myTotal / msg.myCount }

complexClient.send({ txt: 'Hi', myTotal: 1337, myCount: 23 })
Something went wrong with that request. Please try again.