I am trying to use Core's IoC and DI for my application no WEB related stuff (no dispatcher servlet and no web.xml). Initially I used to call simple API
and everything worked fine.Code:PropertyConfigurator.configure( "./resource/log4j.config.xml" );
Now I decided to move the spring way, and added the spring capabilities and the metadata in form of XML.
When I tried to use this application I get the following warning when I get the Bean from ClassPathXMLApplicationContext object.
I am still calling this API as part of initialization in the class object I create using the bean and have even added
in the log4j file.Code:log4j.logger.org.springframework.context.support.ClassPathXmlApplicationContext=OFF, Console
Code:log4j:WARN No appenders could be found for logger (org.springframework.context.support.ClassPathXmlApplicationContext). log4j:WARN Please initialize the log4j system properly.
I have tried to add
but of no use. Does anyone knows the source of the issue? and how to fix it?Code:<bean id="log4jInitialization" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"> <property name="targetClass" value="org.springframework.util.Log4jConfigurer" /> <property name="targetMethod" value="initLogging" /> <property name="arguments"> <list> <value>resources/log4j.config.properties</value> </list> </property> </bean>






Reply With Quote
