Forgot to mention that I also tried adding the following to 
project.properties:

#setup for junit testing
maven.junit.sysproperties=log4j.configuration
log4j.configuration=log4j.properties

which didn't help either...

Hans

On Wednesday 24 August 2005 18:13, SainTiss wrote:
> hi,
>
> I'm trying to use log4j logging in my JUnit tests instead of some
> System.out.println statements I have there...
>
> So i did the following:
>
> 1) add the following to my test class:
> private static final Logger logger =
> Logger.getLogger(StmdsocTest.class);
>
> 2) Put this log4j.properties file in the top maven dir:
> log4j.appender.appenderName=be.ac.ua.fots.stmdsoc.test.StmdsocTest
> log4j.appender.be.ac.ua.fots.stmdsoc.test.StmdsocTest=org.apache.log4j.
> ConsoleAppender
> log4j.category.be.ac.ua.fots.stmdsoc.test.StmdsocTest=INFO
>
> However, when the tests commence, I always get this warning:
> log4j:WARN No appenders could be found for logger
> (be.ac.ua.fots.stmdsoc.test.StmdsocTest). log4j:WARN Please initialize
> the log4j system properly.
>
> This probably means my log4j.properties file is not found?
>
> I also tried putting the file in src/ and adding it as a <resource> in
> project.xml, both as a normal resource and a unittest resource, but to
> no avail...
>
> Does anyone have any idea as to how this can be solved?
>
> Thanks,
>
> Hans

-- 
Ark Linux - Linux for the Masses (http://arklinux.org)

If we cannot live so as to be happy, let us at least live so as to deserve it
 -- Immanuel Hermann Fichte

Capitalism: 
You don't have any cows. The bank will not lend you money to buy cows, 
because you don't have any cows to put up as collateral.

Representative Democracy:
You have two cows. Your neighbors pick someone to tell you who gets the milk. 

In a world without walls and fences, who needs windows and gates?

I'm a fool. Therefore I'm not.

Hans Schippers
Aspirant FWO - Vlaanderen
Formal Techniques in Software Engineering (FoTS)
University of Antwerp
Middelheimlaan 1
2020 Antwerpen - Belgium
Phone: +32 3 265 38 71
Fax: +32 3 265 37 77

Attachment: pgpJExSb8rbJh.pgp
Description: PGP signature

Reply via email to