Hi Team,

We are migrating our application from log4j to log4j2 and  using the
log4j.2.17.1 version now. I have come across TCPSocketServer which is used
in the higher version  instead of Socket Node. But I could not see the same
class on 2.17.1 version. Please let me know how to write remote logs .
Below is the sample code used in the current log4j version.

ServerSocket serverSocket = new ServerSocket(port, backlog, bindAddress);
Socket lSocket = serverSocket.accept();
InetAddress lAddr = lSocket.getInetAddress();
LoggerRepository lRepo = getLoggerRepository(lAddr);
SocketNode lNode = new SocketNode(lSocket, lRepo);
String lClientHost = lAddr.getHostName();
SocketThread lThread = new SocketThread(lNode, lClientHost);

Gajendra S V

Reply via email to