logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jeffrey_chavis" <Jeffrey.cha...@jhuapl.edu>
Subject log4j xml configuration
Date Fri, 03 Oct 2003 15:43:41 GMT
I am having problems getting log4j to configure from an XML file. 
When I use the xml file shown below, i get the following warning in 
java (1.4.1_02). Note: When I use a non-XML properties file it works 
just fine.

log4j:WARN No appenders could be found for logger 
(edu.jhuapl.latency.GNCSTlatencylog4j).

log4j:WARN Please initialize the log4j system properly.

Any ideas? Thanks in advance.

Here is the xml file
---------------------

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
                     	   debug="true">

<!-- Console Appender -->
	<appender name="stdout" 
class="org.apache.log4j.ConsoleAppender">
		<layout class="org.apache.log4j.PatternLayout">
  		     <param name="ConversionPattern"
                            value="%d{ISO8601} %-5p %C{2} [%t] (%F:%
L) - %m%n"/>
		</layout>
	</appender>

<!-- Rolling file Appender -->
	<appender name="R" 
class="org.apache.log4j.RollingFileAppender">
		<param name="File" value="log/gncst.log"/>
		<param name="MaxFileSize" value="1000KB"/>
		<param name="MaxBackupIndex" value="5"/>
		<layout class="org.apache.log4j.PatternLayout">
  		     <param name="ConversionPattern"
                            value="%d{ISO8601} %-5p %C{2} [%t] (%F:%
L) - %m%n"/>
		</layout>
	</appender>

<!-- LogFactor5 appender -->
	<appender name="LF5_CLIENT" 
class="org.apache.log4j.lf5.LF5Appender">
		<param name="MaxNumberOfRecords" value="1000"/>
	</appender>

<!-- JDBC Appender -->
	<appender name="JDBC" 
class="org.apache.log4j.jdbcplus.JDBCAppender">
		<param name="url" 
value="jdbc:oracle:thin:@tofu:1521:gncst"/>
		<param name="username" value="gdba"/>
		<param name="password" value="gdba"/>
		<param name="sql"
                       value="INSERT INTO latency_log
(LATENCY_IDENTIFIER, EVENT, COMPONENT, PROCESSING_LEVEL, 
SECURITY_LEVEL, MESSAGE, TIMESTAMP) VALUES (@LATENCY_IDENTIFIER@, 
@EVENT@, @COMPONENT@, @PROCESSING_LEVEL@, @SECURITY_LEVEL@, 
@MESSAGE@, @TIMESTAMP@)"/>
		<param name="buffer" value="1"/>
		<param name="commit" value="Y"/>
		<layout class="org.apache.log4j.PatternLayout">
  		     <param name="ConversionPattern"
                            value="%d{ISO8601} %-5p %C{2} [%t] (%F:%
L) - %m%n"/>
		</layout>
	</appender>

<!-- Root debugger -->
	<root>
		<priority value="debug"/>
	        <appender-ref ref="stdout"/>
		<appender-ref ref="R"/>
		<appender-ref ref="LF5_CLIENT"/>
		<appender-ref ref="JDBC"/>
	</root>

</log4j:configuration>




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


Mime
View raw message