james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r756408 - in /james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket: AbstractJamesHandler.java AbstractJamesService.java
Date Fri, 20 Mar 2009 10:37:35 GMT
Author: rdonkin
Date: Fri Mar 20 10:37:32 2009
New Revision: 756408

URL: http://svn.apache.org/viewvc?rev=756408&view=rev
Log:
Identified the handler when it logs. JAMES-896 https://issues.apache.org/jira/browse/JAMES-896

Modified:
    james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AbstractJamesHandler.java
    james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AbstractJamesService.java

Modified: james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AbstractJamesHandler.java
URL: http://svn.apache.org/viewvc/james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AbstractJamesHandler.java?rev=756408&r1=756407&r2=756408&view=diff
==============================================================================
--- james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AbstractJamesHandler.java
(original)
+++ james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AbstractJamesHandler.java
Fri Mar 20 10:37:32 2009
@@ -167,7 +167,7 @@
         } catch (RuntimeException e) {
             StringBuffer exceptionBuffer = 
                 new StringBuffer(256)
-                    .append("Unexpected exception opening from ")
+                    .append("[" + toString() + "] Unexpected exception opening from ")
                     .append(remoteHost)
                     .append(" (")
                     .append(remoteIP)
@@ -179,7 +179,7 @@
         } catch (IOException e) {
             StringBuffer exceptionBuffer = 
                 new StringBuffer(256)
-                    .append("Cannot open connection from ")
+                    .append("[" + toString() + "] Cannot open connection from ")
                     .append(remoteHost)
                     .append(" (")
                     .append(remoteIP)
@@ -193,7 +193,7 @@
         if (getLogger().isInfoEnabled()) {
             StringBuffer infoBuffer =
                 new StringBuffer(128)
-                        .append("Connection from ")
+                        .append("[" + toString() + "]Connection from ")
                         .append(remoteHost)
                         .append(" (")
                         .append(remoteIP)
@@ -218,7 +218,7 @@
                 inReader.close();
             }
         } catch (IOException ioe) {
-            getLogger().warn("Handler: Unexpected exception occurred while closing reader:
" + ioe);
+            getLogger().warn("[" + toString() + "] Unexpected exception occurred while closing
reader: " + ioe);
         } finally {
             inReader = null;
         }
@@ -236,7 +236,7 @@
                 socket.close();
             }
         } catch (IOException ioe) {
-            getLogger().warn("Handler: Unexpected exception occurred while closing socket:
" + ioe);
+            getLogger().warn("[" + toString() + "] Unexpected exception occurred while closing
socket: " + ioe);
         } finally {
             socket = null;
         }
@@ -261,13 +261,13 @@
             // Do something:
             handleProtocol();
             
-            logger.debug("Closing socket.");
+            logger.debug("[" + toString() + "] Closing socket");
         } catch (SocketException se) {
             // Indicates a problem at the underlying protocol level
             if (logger.isWarnEnabled()) {
                 String message =
                     new StringBuffer(64)
-                        .append("Socket to ")
+                        .append("[" + toString() + "]Socket to ")
                         .append(remoteHost)
                         .append(" (")
                         .append(remoteIP)
@@ -280,7 +280,7 @@
             if (logger.isErrorEnabled()) {
                 StringBuffer errorBuffer =
                     new StringBuffer(64)
-                        .append("Socket to ")
+                        .append("[" + toString() + "] Socket to ")
                         .append(remoteHost)
                         .append(" (")
                         .append(remoteIP)
@@ -291,7 +291,7 @@
             if (logger.isWarnEnabled()) {
                 String message =
                     new StringBuffer(256)
-                            .append("Exception handling socket to ")
+                            .append("[" + toString() + "] Exception handling socket to ")
                             .append(remoteHost)
                             .append(" (")
                             .append(remoteIP)
@@ -316,7 +316,7 @@
      */
     protected void errorHandler(RuntimeException e) {
         if (getLogger().isErrorEnabled()) {
-            getLogger().error( "Unexpected runtime exception: "
+            getLogger().error( "[" + toString() + "] Unexpected runtime exception: "
                                + e.getMessage(), e );
         }
     }
@@ -359,7 +359,7 @@
      */
     void idleClose() {
         if (getLogger() != null) {
-            getLogger().error("Service Connection has idled out.");
+            getLogger().error("[" + toString() + "] Service Connection has idled out.");
         }
         try {
             if (socket != null) {
@@ -391,7 +391,7 @@
      */
     private final void logResponseString(String responseString) {
         if (getLogger().isDebugEnabled()) {
-            getLogger().debug("Sent: " + responseString);
+            getLogger().debug("[" + toString() + "] Sent: " + responseString);
         }
     }
 

Modified: james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AbstractJamesService.java
URL: http://svn.apache.org/viewvc/james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AbstractJamesService.java?rev=756408&r1=756407&r2=756408&view=diff
==============================================================================
--- james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AbstractJamesService.java
(original)
+++ james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AbstractJamesService.java
Fri Mar 20 10:37:32 2009
@@ -672,7 +672,7 @@
         AbstractJamesHandler theHandler = (AbstractJamesHandler)theHandlerPool.get();
         
         if (getLogger().isDebugEnabled()) {
-            getLogger().debug("Getting Handler from pool.");
+            getLogger().debug("Handler [" +  theHandler + "] obtained from pool.");
         }
 
         Watchdog theWatchdog = theWatchdogFactory.getWatchdog(theHandler.getWatchdogTarget());
@@ -690,7 +690,7 @@
      */
     public void releaseConnectionHandler( ConnectionHandler connectionHandler ) {
         if (getLogger().isDebugEnabled()) {
-            getLogger().debug("Returning Handler to pool.");
+            getLogger().debug("Returning Handler [" +  connectionHandler + "] to pool.");
         }
         theHandlerPool.put((Poolable)connectionHandler);
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message