Browse Source

AMBARI-4893. Avoid printing stacktrace for state machine exceptions. (swagle)

Siddharth Wagle 11 years ago
parent
commit
778f59e975

+ 5 - 1
ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java

@@ -358,7 +358,11 @@ public class HeartBeatHandler {
         } catch (ServiceComponentNotFoundException scnex) {
           LOG.warn("Service component not found ", scnex);
         } catch (InvalidStateTransitionException ex) {
-          LOG.warn("State machine exception", ex);
+          if (LOG.isDebugEnabled()) {
+            LOG.warn("State machine exception.", ex);
+          } else {
+            LOG.warn("State machine exception. " + ex.getMessage());
+          }
         }
       }
     }