garydgregory commented on a change in pull request #709:
URL: https://github.com/apache/logging-log4j2/pull/709#discussion_r785996466



##########
File path: 
log4j-1.2-api/src/main/java/org/apache/log4j/builders/AbstractBuilder.java
##########
@@ -91,7 +91,11 @@ protected String getValueAttribute(Element element) {
     }
 
     public boolean getBooleanProperty(String key) {
-        return Boolean.parseBoolean(getProperty(key, 
Boolean.FALSE.toString()));
+        return getBooleanProperty(key, false);
+    }
+
+    public boolean getBooleanProperty(String key, boolean defaultValue) {

Review comment:
       Good refactoring! :-)

##########
File path: 
log4j-1.2-api/src/main/java/org/apache/log4j/builders/layout/TTCCLayoutBuilder.java
##########
@@ -91,10 +91,10 @@ public Layout parseLayout(Element layoutElement, 
XmlConfiguration config) {
 
     @Override
     public Layout parseLayout(PropertiesConfiguration config) {
-        boolean threadPrinting = getBooleanProperty(THREAD_PRINTING_PARAM);
-        boolean categoryPrefixing = 
getBooleanProperty(CATEGORY_PREFIXING_PARAM);
-        boolean contextPrinting = getBooleanProperty(CONTEXT_PRINTING_PARAM);
-        String dateFormat = getProperty(DATE_FORMAT_PARAM);
+        boolean threadPrinting = getBooleanProperty(THREAD_PRINTING_PARAM, 
true);

Review comment:
       I can see this change matches what the defaults are indeed in Log4j 1.2 
(true values) but we need a test that shows that this change works.
   TY!
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to