1. <category> -> <logger>
2. Remove class attribute from category/logger.
3. Define a <root> node at the bottom.
On 1/16/07, Lisa <[EMAIL PROTECTED]> wrote:
I have read all the documentation I could find on using an XML config file for
Log4J (slim pickings) but can not figure out how to log INFO messages to a file
that come from a specific package.
Any help would be appreciated.
I have a file appender that I want to limit to:
1. info
2. by package name
My appender looks like this:
<!-- ******************************************************************* -->
<!-- Appender used for all JSF debugging -->
<appender name="JSF.INFO.LOG"
class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="jsf.info.log"/>
<param name="Append" value="false"/>
<param name="ImmediateFlush" value="true"/>
<param name="Threshold" value="info"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern"
value="%d %-5p [%t] %c %C (%F:%L) - %m\n"/>
</layout>
</appender>
The limiting categories looks like this:
<!-- JSF Limiting Categories -->
<!-- myfaces-api -->
<category
name="org.apache.log4j.xml"
additivity="false"
class="javax.faces">
<priority value="info"/>
<appender-ref ref="JSF.INFO.LOG"/>
</category>
<!-- myfaces-impl -->
<category
name="org.apache.log4j.xml"
additivity="false"
class="org.apache.myfaces">
<priority value="info"/>
<appender-ref ref="JSF.INFO.LOG"/>
</category>
The idea is to have all INFO messages from org.apache.myfaces & javax.faces go
to a jsf.info.log file.
---
Here is the exception that I get what I get when I launch my servlet/jsp/jsf
container (running under tomcat)
log4j: Desired logger sub-class: [javax.faces]
log4j:ERROR Could not retrieve category [org.apache.log4j.xml]. Reported error
follows.
java.lang.ClassNotFoundException: javax.faces
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
---
I have the javax.faces (jar) packaged in my web application (war), which is then
deployed to Tomcat (which is now configured to use log4j)
---
Also is is possilbe to specify that the log file should go under
$CATALINA_HOME/logs?
How do I specify in the XML file where the log file should go?
Thanks
Lisa
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
James Stauffer http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]