[teiid-commits] teiid SVN: r4452 - in trunk: engine/src/main/resources/org/teiid/query and 3 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Mon Sep 17 12:30:02 EDT 2012


Author: shawkins
Date: 2012-09-17 12:30:02 -0400 (Mon, 17 Sep 2012)
New Revision: 4452

Modified:
   trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
   trunk/engine/src/main/resources/org/teiid/query/i18n.properties
   trunk/runtime/src/main/java/org/teiid/runtime/EmbeddedServer.java
   trunk/runtime/src/main/java/org/teiid/transport/ServerWorkItem.java
   trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties
Log:
TEIID-2172 general logging cleanups

Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java	2012-09-17 16:29:05 UTC (rev 4451)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java	2012-09-17 16:30:02 UTC (rev 4452)
@@ -326,8 +326,6 @@
 	}
 
 	private void handleThrowable(Throwable e) {
-		LogManager.logDetail(LogConstants.CTX_DQP, e, "Request Thread", requestID, "- error occurred"); //$NON-NLS-1$ //$NON-NLS-2$
-		
 		if (!isCanceled()) {
 			dqpCore.logMMCommand(this, Event.ERROR, null);
 		    //Case 5558: Differentiate between system level errors and
@@ -345,10 +343,17 @@
 		    	} else {
 		    		elem = cause.getMessage();
 		    	}
-		        LogManager.logWarning(LogConstants.CTX_DQP, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30020, e.getMessage(), requestID, e.getClass().getName(), elem));
+		        String msg = QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30020, e.getMessage(), requestID, e.getClass().getName(), elem);
+		    	if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) {
+		    		LogManager.logWarning(LogConstants.CTX_DQP, e, msg);
+		    	} else {
+		    		LogManager.logWarning(LogConstants.CTX_DQP, msg + QueryPlugin.Util.getString("stack_info")); //$NON-NLS-1$		    		
+		    	}
 		    } else {
 		        LogManager.logError(LogConstants.CTX_DQP, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30019, requestID));
-		    }                                
+		    }                             
+		} else {
+			LogManager.logDetail(LogConstants.CTX_DQP, e, "Request Thread", requestID, "- error occurred after cancel"); //$NON-NLS-1$ //$NON-NLS-2$
 		}
 		
 		this.processingException = e;

Modified: trunk/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/org/teiid/query/i18n.properties	2012-09-17 16:29:05 UTC (rev 4451)
+++ trunk/engine/src/main/resources/org/teiid/query/i18n.properties	2012-09-17 16:30:02 UTC (rev 4452)
@@ -846,7 +846,8 @@
 
 TEIID30028=Failed to properly rollback autowrap transaction properly
 TEIID30019=Unexpected exception for request {0}
-TEIID30020=Processing exception ''{0}'' for request {1}.  Exception type {2} thrown from {3}. Enable more detailed logging to see the entire stacktrace.
+TEIID30020=Processing exception ''{0}'' for request {1}.  Exception type {2} thrown from {3}.
+stack_info=\ Enable more detailed logging to see the entire stacktrace.
 
 # #query (018.005)
 ERR.018.005.0095 = User <{0}> is not entitled to action <{1}> for 1 or more of the groups/elements/procedures.

Modified: trunk/runtime/src/main/java/org/teiid/runtime/EmbeddedServer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/runtime/EmbeddedServer.java	2012-09-17 16:29:05 UTC (rev 4451)
+++ trunk/runtime/src/main/java/org/teiid/runtime/EmbeddedServer.java	2012-09-17 16:30:02 UTC (rev 4452)
@@ -333,8 +333,8 @@
 		this.sessionService.setDqp(this.dqp);
 		this.services.setSecurityHelper(this.sessionService.getSecurityHelper());
 		this.logon = new LogonImpl(sessionService, null);
-		services.registerClientService(ILogon.class, logon, null);
-		services.registerClientService(DQP.class, dqp, null);
+		services.registerClientService(ILogon.class, logon, LogConstants.CTX_SECURITY);
+		services.registerClientService(DQP.class, dqp, LogConstants.CTX_DQP);
 		initDriver();
 		running = true;
 	}

Modified: trunk/runtime/src/main/java/org/teiid/transport/ServerWorkItem.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/ServerWorkItem.java	2012-09-17 16:29:05 UTC (rev 4451)
+++ trunk/runtime/src/main/java/org/teiid/transport/ServerWorkItem.java	2012-09-17 16:30:02 UTC (rev 4452)
@@ -40,8 +40,10 @@
 import org.teiid.core.crypto.CryptoException;
 import org.teiid.logging.LogConstants;
 import org.teiid.logging.LogManager;
+import org.teiid.logging.MessageLevel;
 import org.teiid.net.socket.Message;
 import org.teiid.net.socket.ServiceInvocationStruct;
+import org.teiid.query.QueryPlugin;
 import org.teiid.runtime.RuntimePlugin;
 import org.teiid.transport.ClientServiceRegistryImpl.ClientService;
 
@@ -159,7 +161,11 @@
 			cause = cause.getCause();
 		}
 		StackTraceElement elem = cause.getStackTrace()[0];
-		LogManager.logDetail(context, e, "Processing exception for session", this.socketClientInstance.getWorkContext().getSessionId()); //$NON-NLS-1$ 
-		LogManager.logWarning(context, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40011, e.getMessage(), this.socketClientInstance.getWorkContext().getSessionId(), e.getClass().getName(), elem));
+		String msg = RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40011, e.getMessage(), this.socketClientInstance.getWorkContext().getSessionId(), e.getClass().getName(), elem);
+		if (LogManager.isMessageToBeRecorded(context, MessageLevel.DETAIL)) {
+			LogManager.logWarning(context, e, msg);
+		} else {
+			LogManager.logWarning(context, msg + QueryPlugin.Util.getString("stack_info")); ////$NON-NLS-1$
+		}
 	}
 }
\ No newline at end of file

Modified: trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties
===================================================================
--- trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties	2012-09-17 16:29:05 UTC (rev 4451)
+++ trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties	2012-09-17 16:30:02 UTC (rev 4452)
@@ -32,7 +32,7 @@
 TEIID40007 = Keepalive failed for session {0}
 TEIID40009 = Admin [{0}] is terminating this session: {1}.  
 TEIID40017=Unexpected exception for session {0}
-TEIID40011=Processing exception ''{0}'' for session {1}.  Exception type {2} thrown from {3}. Enable more detailed logging to see the entire stacktrace.
+TEIID40011=Processing exception ''{0}'' for session {1}.  Exception type {2} thrown from {3}.
 TEIID40070=Only {0} connections are allowed on this port.  Component not found: {1}
 
 SocketTransport.1=Bound to address {0} listening on port {1}



More information about the teiid-commits mailing list