Details
-
Improvement
-
Resolution: Fixed
-
Major
-
1.0.10
-
None
Description
In SocketAppenderBase.connect, the Socket constructor is invoked directly to create a new socket. This makes it difficult for a subclass to have any influence over the creation of sockets (e.g. to use an SSL socket).
If SocketAppenderBase declared at method such as this:
protected SocketFactory getSocketFactory() {
return SocketFactory.getDefault()
}
and used it in the connect() implementation...
...
oos = new ObjectOutputStream(getSocketFactory().createSocket(address, port).getOutputStream());
...
then a subclass could override it with, for example, an appropriately configured SSLSocketFactory...
public class MySSLSocketAppender extends SocketAppender {
...
protected SocketFactory getSocketFactory()
...
}
Attachments
Issue Links
- blocks
-
LOGBACK-816 SimpleSocketServer should use a ServerSocketFactory and allow subclasses to provide it
- Closed