You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by ca...@apache.org on 2007/08/22 23:19:56 UTC

svn commit: r568753 - in /logging/log4j/companions/extras/trunk/src/main: java/org/apache/log4j/extras/DOMConfigurator.java resources/org/apache/log4j/extras/log4j.dtd

Author: carnold
Date: Wed Aug 22 14:19:55 2007
New Revision: 568753

URL: http://svn.apache.org/viewvc?rev=568753&view=rev
Log:
Bug 17531: Add reset option to DOMConfigurator

Modified:
    logging/log4j/companions/extras/trunk/src/main/java/org/apache/log4j/extras/DOMConfigurator.java
    logging/log4j/companions/extras/trunk/src/main/resources/org/apache/log4j/extras/log4j.dtd

Modified: logging/log4j/companions/extras/trunk/src/main/java/org/apache/log4j/extras/DOMConfigurator.java
URL: http://svn.apache.org/viewvc/logging/log4j/companions/extras/trunk/src/main/java/org/apache/log4j/extras/DOMConfigurator.java?rev=568753&r1=568752&r2=568753&view=diff
==============================================================================
--- logging/log4j/companions/extras/trunk/src/main/java/org/apache/log4j/extras/DOMConfigurator.java (original)
+++ logging/log4j/companions/extras/trunk/src/main/java/org/apache/log4j/extras/DOMConfigurator.java Wed Aug 22 14:19:55 2007
@@ -93,6 +93,7 @@
   static final String THRESHOLD_ATTR       = "threshold";
   static final String CONFIG_DEBUG_ATTR  = "configDebug";
   static final String INTERNAL_DEBUG_ATTR  = "debug";
+  private static final String RESET_ATTR  = "reset";
   static final String RENDERING_CLASS_ATTR = "renderingClass";
   static final String RENDERED_CLASS_ATTR = "renderedClass";
 
@@ -832,6 +833,18 @@
       LogLog.setInternalDebugging(OptionConverter.toBoolean(debugAttrib, true));
     } else {
       LogLog.debug("Ignoring " + INTERNAL_DEBUG_ATTR + " attribute.");
+    }
+
+      //
+      //   reset repository before configuration if reset="true"
+      //       on configuration element.
+      //
+    String resetAttrib = subst(element.getAttribute(RESET_ATTR));
+    LogLog.debug("reset attribute= \"" + resetAttrib +"\".");
+    if(!("".equals(resetAttrib))) {
+         if (OptionConverter.toBoolean(resetAttrib, false)) {
+             repository.resetConfiguration();
+         }
     }
 
 

Modified: logging/log4j/companions/extras/trunk/src/main/resources/org/apache/log4j/extras/log4j.dtd
URL: http://svn.apache.org/viewvc/logging/log4j/companions/extras/trunk/src/main/resources/org/apache/log4j/extras/log4j.dtd?rev=568753&r1=568752&r2=568753&view=diff
==============================================================================
--- logging/log4j/companions/extras/trunk/src/main/resources/org/apache/log4j/extras/log4j.dtd (original)
+++ logging/log4j/companions/extras/trunk/src/main/resources/org/apache/log4j/extras/log4j.dtd Wed Aug 22 14:19:55 2007
@@ -44,6 +44,7 @@
   xmlns:log4j              CDATA #FIXED "http://jakarta.apache.org/log4j/" 
   threshold                (all|trace|debug|info|warn|error|fatal|off|null) "null"
   debug                    (true|false|null)  "null"
+  reset                    (true|false) "false"
 >
 
 <!-- renderer elements allow the user to customize the conversion of  -->



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org