You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by da...@apache.org on 2007/04/26 10:36:57 UTC

svn commit: r532662 - /incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/RequestLogger.java

Author: dashorst
Date: Thu Apr 26 01:36:56 2007
New Revision: 532662

URL: http://svn.apache.org/viewvc?view=rev&rev=532662
Log:
Failing to determine session size does not end request logging: typically this happens when something is not serializable (Hibernate session that is still open) and should be logged. However if the request log is not written, this makes fixing the issue a lot harder. This catch all already happens in RequestCycle#detach so it doesn't alter the behavior in a negative way by unwarrented catching of exceptions.

Modified:
    incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/RequestLogger.java

Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/RequestLogger.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/RequestLogger.java?view=diff&rev=532662&r1=532661&r2=532662
==============================================================================
--- incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/RequestLogger.java (original)
+++ incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/RequestLogger.java Thu Apr 26 01:36:56 2007
@@ -222,7 +222,17 @@
 			long sizeInBytes = -1;
 			if (Application.get().getRequestLoggerSettings().getRecordSessionSize())
 			{
-				sizeInBytes = session.getSizeInBytes();
+				try
+				{
+					sizeInBytes = session.getSizeInBytes();
+				}
+				catch (Exception e)
+				{
+					// log the error and let the request logging continue (this is what happens in the
+					// detach phase of the request cycle anyway. This provides better diagnostics).
+					log.error("Exception while determining the size of the session in the request logger: " 
+					        + e.getMessage(), e);
+				}
 			}
 			rd.setSessionSize(sizeInBytes);
 			rd.setTimeTaken(timeTaken);