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

winston-syslog

Package Overview
Dependencies
Maintainers
4
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

winston-syslog - npm Package Compare versions

Comparing version 1.2.5 to 1.2.6

lib/utils.js

38

lib/winston-syslog.js

@@ -13,2 +13,3 @@ /*

cycle = require('cycle'),
utils = require('./utils'),
glossy = require('glossy'),

@@ -63,10 +64,11 @@ winston = require('winston'),

this.protocol = options.protocol || 'udp4';
this.isDgram = /^udp|^unix/.test(this.protocol);
this.endOfLine = options.eol;
if (!/^udp|unix|unix-connect|tcp/.test(this.protocol)) {
throw new Error('Invalid syslog protocol: ' + this.protocol);
}
var parsedProtocol = utils.parseProtocol(this.protocol);
if (/^unix/.test(this.protocol) && !this.path) {
this.protocolType = parsedProtocol.type;
this.protocolFamily = parsedProtocol.family;
this.isDgram = parsedProtocol.isDgram;
this.endOfLine = options.eol;
if (this.protocolType === 'unix' && !this.path) {
throw new Error('`options.path` is required on unix dgram sockets.');

@@ -186,3 +188,3 @@ }

if (self.protocol.match(/^udp/)) {
if (self.protocolType === 'udp') {
self.inFlight++;

@@ -262,10 +264,11 @@ self.socket.send(buffer, 0, buffer.length, self.port, self.host, onError);

if (this.isDgram) {
if (self.protocol.match(/^udp/)) {
this.socket = new dgram.Socket(this.protocol);
if (this.protocol === 'unix-connect') {
return this._unixDgramConnect(callback);
}
else if (self.protocol === 'unix') {
else if (this.protocol === 'unix') {
this.socket = require('unix-dgram').createSocket('unix_dgram');
}
else {
return this._unixDgramConnect(callback);
// UDP protocol
this.socket = new dgram.Socket(this.protocol);
}

@@ -276,3 +279,3 @@

else {
this.socket = new net.Socket({ type: this.protocol });
this.socket = new net.Socket();
this.socket.setKeepAlive(true);

@@ -340,3 +343,12 @@ this.socket.setNoDelay();

this.socket.connect(this.port, this.host);
var connectConfig = {
host: this.host,
port: this.port
};
if (this.protocolFamily) {
connectConfig.family = this.protocolFamily;
}
this.socket.connect(connectConfig);
};

@@ -343,0 +355,0 @@

{
"name": "winston-syslog",
"description": "A syslog transport for winston",
"version": "1.2.5",
"version": "1.2.6",
"author": "Charlie Robbins <charlie.robbins@gmail.com>",

@@ -6,0 +6,0 @@ "contributors": [

@@ -49,3 +49,3 @@ # winston-syslog

* __localhost:__ Host to indicate that log messages are coming from (Default: `localhost`).
* __type:__ The type of the syslog protocol to use (Default: `BSD`).
* __type:__ The type of the syslog protocol to use (Default: `BSD`, also valid: `5424`).
* __app_name:__ The name of the application (Default: `process.title`).

@@ -52,0 +52,0 @@ * __eol:__ The end of line character to be added to the end of the message (Default: Message without modifications).

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