I have a spring bean that has a log member and I use this logger to log some activities.
I also wrote a test case that uses SpringJUnit4ClassRunner . I configured Log4j with the properties file and in each test case I initialize the logger with these properties:
@BeforeClass public static void init() { PropertyConfigurator.configure("src/com/config/log4j.properties"); }
when i run the test it gives me a warning
log4j:WARN No appenders could be found for logger (org.springframework.test.context.junit4.SpringJUnit4ClassRunner). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html
However, the logger in my bean writes messages to the specified location in log4j.properties, that is, it works fine. Why does log4j give me such warnings?
source share