logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpo...@apache.org
Subject svn commit: r1616252 - in /logging/log4j/log4j2/trunk: log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java src/changes/changes.xml
Date Wed, 06 Aug 2014 14:42:58 GMT
Author: rpopma
Date: Wed Aug  6 14:42:57 2014
New Revision: 1616252

URL: http://svn.apache.org/r1616252
Log:
LOG4J2-729 Emit warning message to console if no configuration file found.

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java
    logging/log4j/log4j2/trunk/src/changes/changes.xml

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java?rev=1616252&r1=1616251&r2=1616252&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java
Wed Aug  6 14:42:57 2014
@@ -434,7 +434,11 @@ public abstract class ConfigurationFacto
                     }
                 }
             }
-            return config != null ? config : new DefaultConfiguration();
+            if (config != null) {
+                return config;
+            }
+            LOGGER.error("No log4j2 configuration file found. Using default configuration:
logging only errors to the console.");
+            return new DefaultConfiguration();
         }
 
         private Configuration getConfiguration(final boolean isTest, final String name) {

Modified: logging/log4j/log4j2/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/changes/changes.xml?rev=1616252&r1=1616251&r2=1616252&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/changes/changes.xml (original)
+++ logging/log4j/log4j2/trunk/src/changes/changes.xml Wed Aug  6 14:42:57 2014
@@ -22,6 +22,9 @@
   </properties>
   <body>
     <release version="2.0.2" date="2014-0?-??" description="Bug fixes and enhancements">
+      <action issue="LOG4J2-729" dev="rpopma" type="fix">
+        Emit warning message to console if no configuration file found.
+      </action>      
       <action issue="LOG4J2-765" dev="rpopma" type="fix">
         Improve warning message when missing log4j-core in the classpath.
       </action>      



Mime
View raw message