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

Attachment: pgpVZ5Krj20ko.pgp
Description: PGP signature

Reply via email to