Hi

you must define the appenders before the loggers within the config file. See 
the dtd file.

Heri

> -----Original Message-----
> From: David Durham [mailto:[EMAIL PROTECTED]
> Sent: Thursday, October 13, 2005 3:06 PM
> To: [email protected]
> Subject: log4j xml configuration problem -- should be easy
> 
> 
> I've tried using the following config with log4j-1.2.12.jar and
> commons-logging 1.0.4 and commons-logging 1.0.5.  The only logger that
> I can get anything out of is the root logger.  Configuration below,
> usage will follow:  (Also, apologies for the formatting; eclipse still
> does not have tab replacement, that I know of, for the text-editor)
> 
> <?xml version="1.0" encoding="UTF-8" ?>
> 
> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/";>
> 
>       <root>
>          <level value="debug"/>
>          <appender-ref ref="rollingFile"/>
>       </root>
> 
>       <logger name="com">
>               <level value="debug"/>
>               <appender-ref ref="rollingFile"/>
>       </logger>
> 
>       <logger name="org">
>               <level value="debug"/>
>               <appender-ref ref="rollingFile"/>
>       </logger>
> 
>     <appender name="rollingFile"
>               class="org.apache.log4j.RollingFileAppender">
>         <layout class="org.apache.log4j.PatternLayout">
>             <param name="ConversionPattern" value="%d{dd MMM yyyy
>                         HH:mm:ss} %c %m%n"/>
>         </layout>
>       <param name="maxFileSize" value="100KB"/>
>         <param name="file" 
> value="/home/ddurham/meijer-store-dir.log"/>
>     </appender>
> 
> </log4j:configuration>
> 
> 
> 
> JSP test usage:
> 
> 
> <%@ page import="org.apache.commons.logging.*" %>
> <%
> Log root = LogFactory.getLog("root");
> root.debug("root");
> 
> Log org = LogFactory.getLog("org");
> org.debug("org");
> 
> Log com = LogFactory.getLog("com");
> com.debug("com");
> %>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to