log4js-logstash-tcp
Advanced tools
Comparing version 1.0.4 to 1.0.5
18
index.js
'use strict'; | ||
const net = require('net'); | ||
const util = require('util'); | ||
const TcpConnectionPool = require("./classes/TcpConnectionPool"); | ||
const tcpConnectionPool = new TcpConnectionPool(); | ||
function sendLog(host, port, logObject) { | ||
const msg = JSON.stringify(logObject) + "\n"; | ||
const tcp = net.connect({host: host, port: port}, function () { | ||
tcp.write(msg, 'utf8', () => { | ||
tcp.end(); | ||
tcp.destroy(); | ||
}); | ||
}); | ||
tcp.on('error', function (evt) { | ||
console.error('An error happened while sending log line to logstash', evt); | ||
}); | ||
tcpConnectionPool.send(host, port, logObject); | ||
} | ||
function logstashTCP(config, layout) { | ||
@@ -22,0 +14,0 @@ const type = config.logType ? config.logType : config.category; |
{ | ||
"name": "log4js-logstash-tcp", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"author": "Aigent B.V.", | ||
@@ -5,0 +5,0 @@ "description": "This is a copy of the logstashUDP appender but instead sending via UDP send via TCP to avoid the maximum 64k bytes message size with the logstashUDP appender.", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27288
7
195
3