For some reason my Eclipse console no longer displays Log4j INFO and DEBUG statements when I run JUnit tests.
In terms of code there hasn't been any change, so it must something to do with the Eclipse configuration.
All I do in my Unit test is the following and for some reason ONLY the ERROR statement is displayed in the Eclipse console. Why?
Where shall I look for clues?
public class SampleTest
{
private static final Logger LOGGER = Logger.getLogger(SampleTest.class);
@Before
public void init() throws Exception
{
// Log4J junit configuration.
BasicConfigurator.configure();
LOGGER.info("INFO TEST");
LOGGER.debug("DEBUG TEST");
LOGGER.error("ERROR TEST");
}
}
Details:
- log4j-1.2.6.jar
- junit-4.6.jar Eclipse
- IDE for Java Developers, Version:
Helios Release, Build id:
20100617-1415
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…