Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gelf-stream

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gelf-stream - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

24

gelf-stream.js
var gelfStream = exports
var gelfling = require('gelfling')
var map = require('map-stream')
var Stream = require('stream').Stream

@@ -19,10 +19,20 @@ function create(host, port, options) {

var client = gelfling(host, port, options)
, mapStream = map(function send(log, cb) {
if (options.filter && !options.filter(log)) return cb()
client.send(options.map ? options.map(log) : log, cb)
})
, stream = new Stream()
mapStream.on('end', function() { client.close() })
client.errHandler = function(err) {
if (err) stream.emit('error', err)
}
return mapStream
stream.writable = true
stream.write = function(log) {
if (!options.filter || options.filter(log))
client.send(options.map ? options.map(log) : log, client.errHandler)
}
stream.end = function(log) {
if (arguments.length) stream.write(log)
stream.writable = false
process.nextTick(function() { client.close() })
}
return stream
}

@@ -29,0 +39,0 @@

{
"name": "gelf-stream",
"version": "0.2.1",
"version": "0.2.2",
"description": "A stream to send JS objects to a Graylog2 server (in GELF format)",

@@ -20,4 +20,3 @@ "author": "Michael Hart <michael.hart.au@gmail.com> (http://github.com/mhart)",

"dependencies": {
"gelfling": "~0.2.0",
"map-stream": "~0.0.1"
"gelfling": "~0.2.0"
},

@@ -24,0 +23,0 @@ "devDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc