From: adam Date: Sat, 30 Oct 2004 08:47:45 +0000 (+0000) Subject: better logging X-Git-Url: http://git.megacz.com/?p=org.ibex.jinetd.git;a=commitdiff_plain;h=71778e79b8d806591e9701f1798f338bdaa5e8f9 better logging darcs-hash:20041030084745-5007d-f74341a4845a9964203ea4415c536afcff613f40.gz --- diff --git a/src/org/ibex/jinetd/Port.java b/src/org/ibex/jinetd/Port.java index 8ac02a5..a55f7af 100644 --- a/src/org/ibex/jinetd/Port.java +++ b/src/org/ibex/jinetd/Port.java @@ -87,15 +87,20 @@ public class Port extends Loader { void dispatch(final Connection conn) throws Exception { new Thread(tg, new Runnable() { public void run() { + String local = conn.getLocalAddress() + ":" + conn.getLocalPort(); + String remote = conn.getRemoteHostname() + ":" + conn.getRemotePort(); try { Class c = findListener(); if (c == null) throw new RuntimeException("couldn't find listener"); - Log.info(this, "dispatching connection on port " + port + " to " + c.getName()); + Log.info("["+local+"]", "connection from " + remote + " => " + c.getName()); Log.clearnotes(); final ClassLoader cl = getClassLoader(); Thread.currentThread().setContextClassLoader(cl); Listener l = (Listener)c.newInstance(); l.accept(conn); + } catch (org.ibex.io.Stream.EOF eof) { + Log.warn(this, "end of stream reached handling connection from " + + conn.getRemoteHostname() + ":" + conn.getRemotePort()); } catch (Exception e) { Log.error(this, "Listener threw exception"); Log.error(this, e);