From fd31a3616a094d8a4356da183f724f662230ecbc Mon Sep 17 00:00:00 2001 From: orbiter Date: Tue, 16 Jun 2009 15:10:59 +0000 Subject: [PATCH] - more logging in server process - fix for bas ascii in comment git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6084 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/server/serverCore.java | 30 ++++++++----------- .../anomic/tools/SignatureOutputStream.java | 2 +- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/source/de/anomic/server/serverCore.java b/source/de/anomic/server/serverCore.java index ae8143dbb..827a09931 100644 --- a/source/de/anomic/server/serverCore.java +++ b/source/de/anomic/server/serverCore.java @@ -770,40 +770,34 @@ public final class serverCore extends serverAbstractBusyThread implements server } if (terminate) break; - } catch (final InvocationTargetException ite) { - System.out.println("ERROR A " + this.userAddress.getHostAddress()); + } catch (final InvocationTargetException e) { + log.logSevere("command execution, target exception " + e.getMessage() + " for client " + this.userAddress.getHostAddress(), e); // we extract a target exception and let the thread survive - writeLine(this.commandObj.error(ite.getTargetException())); - } catch (final NoSuchMethodException nsme) { - System.out.println("ERROR B " + this.userAddress.getHostAddress()); + writeLine(this.commandObj.error(e.getTargetException())); + } catch (final NoSuchMethodException e) { + log.logSevere("command execution, method exception " + e.getMessage() + " for client " + this.userAddress.getHostAddress(), e); if (!this.userAddress.isSiteLocalAddress()) { if (serverCore.this.denyHost != null) { serverCore.this.denyHost.put((""+this.userAddress.getHostAddress()), "deny"); // block client: hacker attempt } } break; - // the client requested a command that does not exist - //Object[] errorParameter = { nsme }; - //writeLine((String) error.invoke(this.cmdObject, errorParameter)); - } catch (final IllegalAccessException iae) { - System.out.println("ERROR C " + this.userAddress.getHostAddress()); + } catch (final IllegalAccessException e) { + log.logSevere("command execution, illegal access exception " + e.getMessage() + " for client " + this.userAddress.getHostAddress(), e); // wrong parameters: this an only be an internal problem - writeLine(this.commandObj.error(iae)); + writeLine(this.commandObj.error(e)); } catch (final java.lang.ClassCastException e) { - System.out.println("ERROR D " + this.userAddress.getHostAddress()); + log.logSevere("command execution, cast exception " + e.getMessage() + " for client " + this.userAddress.getHostAddress(), e); // ?? writeLine(this.commandObj.error(e)); } catch (final Exception e) { - System.out.println("ERROR E " + this.userAddress.getHostAddress()); + log.logSevere("command execution, generic exception " + e.getMessage() + " for client " + this.userAddress.getHostAddress(), e); // whatever happens: the thread has to survive! writeLine("UNKNOWN REASON:" + this.commandObj.error(e)); } } // end of while - } /* catch (java.lang.ClassNotFoundException e) { - System.out.println("Internal error: Wrapper class not found: " + e.getMessage()); - System.exit(0); - } */ catch (final java.io.IOException e) { - // connection interruption: more or less normal + } catch (final IOException e) { + log.logSevere("command execution, IO exception " + e.getMessage() + " for client " + this.userAddress.getHostAddress(), e); } //announceMoreExecTime(System.currentTimeMillis() - this.start); } diff --git a/source/de/anomic/tools/SignatureOutputStream.java b/source/de/anomic/tools/SignatureOutputStream.java index 1b40a63b0..8a1b161db 100644 --- a/source/de/anomic/tools/SignatureOutputStream.java +++ b/source/de/anomic/tools/SignatureOutputStream.java @@ -5,7 +5,7 @@ // // This is a part of YaCy, a peer-to-peer based web search engine // -// $LastChangedDate: 2009-03-30 17:31:25 +0200 (Mo, 30. Mär 2009) $ +// $LastChangedDate: 2009-03-30 17:31:25 +0200 (Mo, 30. March 2009) $ // $LastChangedRevision: 5756 $ // $LastChangedBy: orbiter $ //