Commit b42404f8 authored by Ralph Goers's avatar Ralph Goers
Browse files

Add some diagnostics

parent fb6afac6
Showing with 7 additions and 0 deletions
+7 -0
......@@ -18,6 +18,7 @@ package org.apache.logging.log4j.core.net.mock;
import java.io.IOException;
import java.io.InputStream;
import java.net.BindException;
import java.net.ServerSocket;
import java.net.Socket;
......@@ -49,6 +50,7 @@ public class MockTcpSyslogServer extends MockSyslogServer {
@Override
public void run() {
System.out.println("TCP Server started");
this.thread = Thread.currentThread();
while (!shutdown) {
try {
......@@ -70,6 +72,8 @@ public class MockTcpSyslogServer extends MockSyslogServer {
System.out.println("Message too long");
}
}
} catch (BindException be) {
be.printStackTrace();
} finally {
if (socket != null) {
socket.close();
......@@ -81,5 +85,6 @@ public class MockTcpSyslogServer extends MockSyslogServer {
}
}
}
System.out.println("TCP Server stopped");
}
}
......@@ -46,6 +46,7 @@ public class MockUdpSyslogServer extends MockSyslogServer {
@Override
public void run() {
System.out.println("UDP Server Started");
this.thread = Thread.currentThread();
final byte[] bytes = new byte[4096];
final DatagramPacket packet = new DatagramPacket(bytes, bytes.length);
......@@ -60,5 +61,6 @@ public class MockUdpSyslogServer extends MockSyslogServer {
Throwables.rethrow(e);
}
}
System.out.println("UDP Server stopped");
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment