Closed shah-dhara closed 9 years ago
I figured out the problem, I didn't handle 'error' event on bunyan tcp stream. It is there in an example, but was not mentioned in the documentation.
@shah-dhara Could you post an example or test case? This would help us to catch this error in bunyan-logstash-tcp
Sure, error came up as for setting up the stream I wrote the following code
stream: bunyantcp.createStream({
host: '127.0.0.1',
port: 9998
})
This was not able to emit the logstash down error and made my NodeJS application crash. I just changed the code to the following:
stream: bunyantcp.createStream({
host: '127.0.0.1',
port: 9998
}).on('error', console.log)
NodeJS application crashes with following error when the logstash server is not reachable:
ERROR
events.js:72 throw er; // Unhandled 'error' event ^ Error: connect ECONNREFUSED at errnoException (net.js:904:11) at Object.afterConnect as oncomplete
Can you please help me to solve this?