Author: carnold
Date: Tue Aug 12 10:03:29 2008
New Revision: 685228
URL: http://svn.apache.org/viewvc?rev=685228&view=rev
Log:
Bug 25747: more explanations when hitting WARN No appenders could be found for
logger
Modified:
logging/log4j/trunk/src/changes/changes.xml
logging/log4j/trunk/src/main/java/org/apache/log4j/Hierarchy.java
logging/log4j/trunk/src/site/fml/faq.fml
Modified: logging/log4j/trunk/src/changes/changes.xml
URL:
http://svn.apache.org/viewvc/logging/log4j/trunk/src/changes/changes.xml?rev=685228&r1=685227&r2=685228&view=diff
==============================================================================
--- logging/log4j/trunk/src/changes/changes.xml (original)
+++ logging/log4j/trunk/src/changes/changes.xml Tue Aug 12 10:03:29 2008
@@ -47,6 +47,7 @@
<action action="fix" issue="43867">Improve warning message when log4j
is accessed after unload by Tomcat.</action>
<action action="fix" issue="45335">NullPointerException in NDC.remove
after unload by Tomcat.</action>
<action action="fix" issue="36384">Configuring triggering/rolling
policys should be supported through properties.</action>
+ <action action="fix" issue="25747">More explanations when hitting WARN
No appenders could be found for logger.</action>
</release>
<release version="1.2.15" date="2007-08-24" description="SyslogAppender
enhancements, NTEventLogAppender and Maven build.">
Modified: logging/log4j/trunk/src/main/java/org/apache/log4j/Hierarchy.java
URL:
http://svn.apache.org/viewvc/logging/log4j/trunk/src/main/java/org/apache/log4j/Hierarchy.java?rev=685228&r1=685227&r2=685228&view=diff
==============================================================================
--- logging/log4j/trunk/src/main/java/org/apache/log4j/Hierarchy.java (original)
+++ logging/log4j/trunk/src/main/java/org/apache/log4j/Hierarchy.java Tue Aug
12 10:03:29 2008
@@ -134,6 +134,7 @@
LogLog.warn("No appenders could be found for logger (" +
cat.getName() + ").");
LogLog.warn("Please initialize the log4j system properly.");
+ LogLog.warn("See http://logging.apache.org/log4j/1.2/faq.html#noconfig
for more info.");
this.emittedNoAppenderWarning = true;
}
}
Modified: logging/log4j/trunk/src/site/fml/faq.fml
URL:
http://svn.apache.org/viewvc/logging/log4j/trunk/src/site/fml/faq.fml?rev=685228&r1=685227&r2=685228&view=diff
==============================================================================
--- logging/log4j/trunk/src/site/fml/faq.fml (original)
+++ logging/log4j/trunk/src/site/fml/faq.fml Tue Aug 12 10:03:29 2008
@@ -839,5 +839,22 @@
the same file path and java.io provides no mechanism to coordinate
writing
between JVM's.</answer>
</faq>
+ <faq id="noconfig">
+ <question>
+ Why do I see a warning about "No appenders found for logger" and
+ "Please configure log4j properly"?
+ </question>
+ <answer>
+ This occurs when the default configuration files log4j.properties
and
+ log4j.xml can not be found and the application performs no
explicit configuration.
+ log4j uses Thread.getContextClassLoader().getResource() to locate
the default
+ configuration files and does not directly check the file system.
+ Knowing the appropriate location to place log4j.properties or
log4j.xml
+ requires understanding the search strategy of the class loader in
use.
+ log4j does not provide a default configuration since output to the
console
+ or to the file system may be prohibited in some environments.
Also see
+ <a href="#a3.5">FAQ: Why can't log4j find my properties in a J2EE
or WAR application?</a>.
+ </answer>
+ </faq>
</part>
</faqs>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]