|
Issue Type:
|
Improvement
|
Affects Versions:
|
1.0.10 |
Assignee:
|
Logback dev list
|
Components:
|
logback-classic, logback-core |
Created:
|
22/Mar/13 4:46 PM
|
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() {
return mySslContext.getSocketFactory()
}
...
}
|
Project:
|
logback
|
Priority:
|
Major
|
Reporter:
|
Carl Harris
|
|
|