logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bender Heri" <HBen...@Ergonomics.ch>
Subject RE: log4j xml configuration problem -- should be easy
Date Thu, 13 Oct 2005 13:12:45 GMT
Hi

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

Heri

> -----Original Message-----
> From: David Durham [mailto:david.durham@gmail.com]
> Sent: Thursday, October 13, 2005 3:06 PM
> To: log4j-user@logging.apache.org
> 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: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message