[logback-user] Please add a timeout to SocketAppenderBase.connect(...)
jhuxhorn at bpinteractive.com
Tue Jul 31 18:37:52 CEST 2007
It would be really great if you could change the line
oos = new ObjectOutputStream(new Socket(address, port).getOutputStream());
in method void connect(InetAddress address, int port) of class
SocketAddress address=new InetSocketAddress(address, port);
Socket socket=new Socket();
oos = new ObjectOutputStream(socket.getOutputStream());
using something reasonable as connectionTimeout, e.g. 1000-2000ms.
connectionTimeout should be configurable, too.
At the moment our webapp waits quite some time if a registered
SocketServer isn't online at startup.
I'd also suggest wrapping the sockets outputstream into a
BufferedOutputStream, flushing it after every event.
More information about the Logback-user