r7366 - dumbhippo/trunk/openfire/src/plugins/hippo/src/java/com/dumbhippo/jive



Author: walters
Date: 2008-03-17 15:16:26 -0500 (Mon, 17 Mar 2008)
New Revision: 7366

Modified:
   dumbhippo/trunk/openfire/src/plugins/hippo/src/java/com/dumbhippo/jive/AnnotatedIQMethod.java
Log:
Add some debug logging to IQ method invocations.


Modified: dumbhippo/trunk/openfire/src/plugins/hippo/src/java/com/dumbhippo/jive/AnnotatedIQMethod.java
===================================================================
--- dumbhippo/trunk/openfire/src/plugins/hippo/src/java/com/dumbhippo/jive/AnnotatedIQMethod.java	2008-03-13 20:02:38 UTC (rev 7365)
+++ dumbhippo/trunk/openfire/src/plugins/hippo/src/java/com/dumbhippo/jive/AnnotatedIQMethod.java	2008-03-17 20:16:26 UTC (rev 7366)
@@ -3,13 +3,15 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.Collection;
+import java.util.Date;
 import java.util.concurrent.Callable;
 
-import org.jivesoftware.util.Log;
 import org.jivesoftware.openfire.XMPPServer;
+import org.slf4j.Logger;
 import org.xmpp.packet.IQ;
 import org.xmpp.packet.JID;
 
+import com.dumbhippo.GlobalSetup;
 import com.dumbhippo.Site;
 import com.dumbhippo.dm.ChangeNotificationSet;
 import com.dumbhippo.dm.DMObject;
@@ -25,6 +27,9 @@
 import com.dumbhippo.tx.TxUtils;
 
 public abstract class AnnotatedIQMethod {
+	@SuppressWarnings("unused")
+	private static final Logger logger = GlobalSetup.getLogger(AnnotatedIQMethod.class);	
+	
 	protected IQMethod annotation;
 	protected AnnotatedIQHandler handler;
 	protected Method method;
@@ -93,8 +98,8 @@
 	}
 	
 	public void runIQ(final IQ request) throws IQException {
-		Log.debug("handling IQ packet " + request);
-
+		logger.debug("Starting IQ request run");
+		long iqStartTime = new Date().getTime();
 		try {
 			final DataModel model = DataService.getModel();
 			final XmppClient client = XmppClientManager.getInstance().getClient(request.getFrom());
@@ -177,10 +182,13 @@
 				}
 			}
 		} catch (IQException e) {
+			logger.error("Failure during IQ request run {}", e.getMessage());			
 			throw e;
 		} catch (Exception e) {
+			logger.error("General failure during IQ request run {}", e);			
 			throw new RuntimeException("Unexpected exception running IQ method in transaction", e);
 		}
+		logger.debug("Completed IQ request run in {}s", (new Date().getTime() - iqStartTime)/1000);		
 	}
 
 	/**



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]