Comparing version 1.3.2 to 1.4.0
# CHANGELOG | ||
## v1.4.0 | ||
* Workaround for issue with node cluster on node 0.11.x (greenboxal) | ||
## v1.3.1 | ||
@@ -4,0 +9,0 @@ |
15
index.js
@@ -45,2 +45,11 @@ var dgram = require('dgram'); | ||
// HACK: On Node v0.11.x bind the socket to ensure that it works when clustering | ||
// THis should be a temporary fix until node fixes the cluster module | ||
if (/^v0\.11\..*$/.test(process.version)) { | ||
socket.bind({ | ||
port: 0, | ||
exclusive: true | ||
}) | ||
} | ||
} | ||
@@ -104,3 +113,3 @@ | ||
fragments.push(formattedMessageBuffer.slice(i * chunkSize, Math.min(formattedMessageBuffer.length, (i + 1) * chunkSize)), | ||
new Buffer(' [' + (i + 1) + '/' + numChunks + ']', 'ascii')); | ||
new Buffer(' [' + (i + 1) + '/' + numChunks + ']', 'ascii')); | ||
} | ||
@@ -111,3 +120,3 @@ } else{ | ||
var chunk = Buffer.concat(fragments); | ||
var chunk = Buffer.concat(fragments); | ||
var socket = getSocket('unix_dgram'); | ||
@@ -257,3 +266,3 @@ socket.send(chunk, | ||
} | ||
if (typeof this.path === 'string' && this.path.length > 0){ | ||
if (typeof this.path === 'string' && this.path.length > 0){ | ||
this.transport = Transport.unix_dgram | ||
@@ -260,0 +269,0 @@ } |
{ | ||
"name": "ain2", | ||
"description": "Syslog logging for node.js. Continuation of ain", | ||
"version": "1.3.2", | ||
"version": "1.4.0", | ||
"main": "./index", | ||
@@ -54,4 +54,4 @@ "author": "Alexander Dorofeev <aka.spin@gmail.com>", | ||
"optionalDependencies": { | ||
"unix-dgram": "0.0.5" | ||
"unix-dgram": "0.1.1" | ||
} | ||
} |
@@ -44,2 +44,11 @@ # ain* | ||
Note: you need to ensure syslog is listening on UDP port 514 for this example to work. On Ubuntu, for example, you would need to edit ```/etc/rsyslog.conf```, add/uncomment the following lines, and ensure rsyslog is restarted: | ||
``` | ||
# provides UDP syslog reception | ||
$ModLoad imudp | ||
$UDPServerAddress 127.0.0.1 | ||
$UDPServerRun 514 | ||
``` | ||
## Singleton logger | ||
@@ -46,0 +55,0 @@ |
# TODO | ||
* TCP support | ||
* Test travis.ci |
33130
744
203