[logback-dev] svn commit: r677 - logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/pattern

noreply.seb at qos.ch noreply.seb at qos.ch
Fri Oct 13 17:40:26 CEST 2006


Author: seb
Date: Fri Oct 13 17:40:25 2006
New Revision: 677

Modified:
   logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/pattern/ThrowableInformationConverter.java

Log:
Added an errorCount in ThrowableInformationConverter.java to that it does not flood the status manager is case of
errors in the expression evaluation


Modified: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/pattern/ThrowableInformationConverter.java
==============================================================================
--- logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/pattern/ThrowableInformationConverter.java	(original)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/pattern/ThrowableInformationConverter.java	Fri Oct 13 17:40:25 2006
@@ -21,6 +21,10 @@
 
   int lengthOption;
   List<EventEvaluator> evaluatorList = null;
+  
+  final int MAX_ERROR_COUNT = 2;
+  int errorCount = 0;
+  
 
   public void start() {
 
@@ -96,7 +100,9 @@
             break;
           }
         } catch (EvaluationException eex) {
-          addError("Exception thrown for evaluator named ["+ee.getName()+"]", eex);
+          if (++errorCount <= MAX_ERROR_COUNT) {
+            addError("Exception thrown for evaluator named ["+ee.getName()+"]", eex);
+          }
         }
       }
 



More information about the logback-dev mailing list