Tuesday, September 09, 2008

Configuring the Class Path When Testing in Eclipse

If you're testing from within Eclipse and are using Apache Commons Logging + log4j and you get the message:
log4j:WARN No appenders could be found for logger

you can let log4j know about the location of the log4j configuration file adding the directory where that file can be found this way:

Right click on the test class and choose Properties --> Run/Debug Settings
Select the file.
Click on Edit and select the Classpath tab.
Select the first item in User Entries, then Advanced, then Add Folders and you're done.

No comments: