java - Logs are not printing -
i working on project has spring used in it. junit, using @runwith(springjunit4classrunner.class) annotation. working fine except not see logs spring processing of applicationcontext. in console window, current message :
log4j:warn no appenders found logger (org.springframework.test.context.support.defaulttestcontextbootstrapper). log4j:warn please initialize log4j system properly. log4j:warn see http://logging.apache.org/log4j/1.2/faq.html#noconfig more info. i have kept log4j.properties in src/main/resources folder of eclipse(using maven project). following contents :
log4j.properties ;
# root logger option log4j.rootlogger=info log4j.appender.stdout=org.apache.log4j.consoleappender log4j.appender.stdout.layout=org.apache.log4j.patternlayout log4j.appender.stdout.layout.conversionpattern=%p\t%d{iso8601}\t%r\t%c \t[%t]\t%m%n have looked @ raised q/a regarding similar issues. still no clue issue. here me please in ?
thanks
you need specify log4j properties stored context param of spring application. can done adding following part inside web.xml. make sure bundle log4j.properties file inside /web-inf/classes/ directory.
<context-param> <param-name>log4jconfiglocation</param-name> <param-value>/web-inf/classes/log4j.properties</param-value> </context-param> <listener> <listener-class>org.springframework.web.util.log4jconfiglistener</listener-class> </listener>
Comments
Post a Comment