eclipse, junit, log4j, & finding log4j.xml

A

Alexandra Stehman

I've tried creating a classpath variable for the project which points
to log4j.xml. I have included the folder containing log4j.xml in the
libraries for the project. For some reason, the log.debug() messages
don't show up in the Eclipse console - but there are no errors
reported, either.

The code in question is a JUnit test and a helper class being tested.
The helper object calls Logger.getLogger(className) to get a reference
to the root logger.

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

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
debug="false
">
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<param name="Threshold" value="DEBUG"/>
<param name="Target" value="System.out"/>

<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n -->
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}]
%m%n"/>
</layout>

</appender>

<root>
<appender-ref ref="CONSOLE"/>
</root>
</log4j:configuration>

-------------------------------------</log4j.xml>------------------------------

Thanks for your help!

Cheers,
Alexandra Stehman
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top