logstash-plugins / logstash-input-tcp

Apache License 2.0
35 stars 75 forks source link

improve error logging to always reveal SSL details #177

Closed kares closed 3 years ago

kares commented 3 years ago

due Netty SSLException wrapping plugin can easily fail with a wrapped error without any additional logging on the wrapped cause (Logstash currently does not log causes when handling errors at the Ruby level), sample logged exception:

[ERROR][logstash.javapipeline ][main] Pipeline error {:pipeline_id=>"main", :exception=>javax.net.ssl.SSLException: failed to initialize the server-side SSL context, :backtrace=>["io.netty.handler.ssl.JdkSslServerContext.newSSLContext(io/netty/handler/ssl/JdkSslServerContext.java:288)", "io.netty.handler.ssl.JdkSslServerContext.(io/netty/handler/ssl/JdkSslServerContext.java:247)", "io.netty.handler.ssl.SslContext.newServerContextInternal(io/netty/handler/ssl/SslContext.java:465)", "io.netty.handler.ssl.SslContextBuilder.build(io/netty/handler/ssl/SslContextBuilder.java:571)", "jdk.internal.reflect.GeneratedMethodAccessor263.invoke(jdk/internal/reflect/GeneratedMethodAccessor263)", "jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(jdk/internal/reflect/DelegatingMethodAccessorImpl.java:43)", "java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:566)", "org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:441)", "org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:305)", "usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_input_minus_tcp_minus_6_dot_0_dot_7_minus_java.lib.logstash.inputs.tcp.compat_ssl_options.toSslContext(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-tcp-6.0.7-java/lib/logstash/inputs/tcp/compat_ssl_options.rb:127)",