index.js
function pushToStash(config, msg) {
        var client = net.connect({host: config.host, port: config.port}, function () {
            client.write(msg);
            client.end();
        });
        //Fail silently
        client.on('error', function (evt) {
            if (true === config.debug) {
                console.log('An error happened in the logstash appender!', evt);
            }
        });
    }
function pushToStash(config, msg) {
        var client = net.connect({host: config.host, port: config.port}, function () {
            client.write(msg);
            client.end();
        });
        //Fail silently
        client.on('error', function (evt) {
            if (true === config.debug) {
                console.log('An error happened in the logstash appender!', evt);
            }
        });
    }
function pushToStash ( config , msg ) { var client = net . connect ( { host : config . host , port : config . port } , function ( ) { client . write ( msg ) ; client . end ( ) ; } ) ; //Fail silently client . on ( 'error' , function ( evt ) { if ( true === config . debug ) { console . log ( 'An error happened in the logstash appender!' , evt ) ; } } ) ; }
Setup the connection to logstash
Setup the connection to logstash