Closed ayashjorden closed 10 years ago
Thanks! Although I must say it is mostly based on the logstash implementation of log4j input which I adapted for log4j2 changes.
The socket exceptions happen mostly because of parse exceptions in Logstash. Can you start logstash with --debug parameter and post the complete exception with stack trace which should show up in the debug output?
Hi, Please see attached. (And thanks for the FAST reply :)
Also, Can you upgrade to log4j2 2.0? they released it few days ago....
Are you on the latest release? Because I released a version 4 days ago which supports 2.0. Current release 3.1 is of 3 days ago: https://github.com/jurmous/logstash-log4j2/releases
Hi, Tried with latest version, but the broken-pipe is still happening.
Finally I found a work-around: removed Async appender and use the socket appender inside an 'asyncRoot' element.
Hi again, Unfortunately my workaround is causing message loss.
I've read some more on async logging in log4j-2 and they use LMAX Disruptor. Only when I use async loggers with "-DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector" I get the "SocketException: Broket pipe" exception.
When I start a standalone TcpSocketServer instance the socket appender(with the above setting) connects with no exceptions... Can you advise?
Thanks, Yarden
Can you check out release 3.2 if it works for you? https://github.com/jurmous/logstash-log4j2/releases/
Like a charm :+1:
I'll do some performance tests now...
Thanks for testing!
Let me know what the results are :smile:
Hi Jurmous,
First I'd like to say that the plugin is GREAT! and easy to use.
The issue occurs when I wrap log4j2-Socket appender with an Async appender.
For some reason the connection gets closed.
My Log4 config is:
my logstash config is:
input { log4j2 { host => localhost port => 8600 mode => server } } output { elasticsearch { host => localhost cluster => "es_test" index => "%{type}-%{+YYYY.MM.dd.HH}" }
}
I'm getting a SocketExcetoion - Broket Pipe.
I also tried with re-connection config and it seems that the connection is getting closed by logstash side.... When I remove the Async appender it works OK(slower, but OK).
The Async+Socket appender works well against a stand-alone log4j-TCPSocketServer instance
Any Ideas??