in collector/log4j-socket/src/main/java/org/apache/karaf/decanter/collector/log/socket/SocketCollector.java [203:226]
public void run() {
try (ObjectInputStream ois = new LoggingEventObjectInputStream(new BufferedInputStream(clientSocket
.getInputStream()))) {
while (open) {
try {
Object event = ois.readObject();
if (event instanceof LoggingEvent) {
handleLog4j((LoggingEvent)event);
}
} catch (ClassNotFoundException e) {
LOGGER.warn("Unable to deserialize event from " + clientSocket.getInetAddress(), e);
}
}
} catch (EOFException e) {
LOGGER.debug("Log client closed the connection.", e);
} catch (IOException e) {
LOGGER.warn("Exception receiving log.", e);
}
try {
clientSocket.close();
} catch (IOException e) {
LOGGER.info("Error closing socket", e);
}
}