java - log4j debug not logging to any of the configured appenders -
logger.getrootlogger().getappender("console") returning null in class can log console. getallappenders() returning nullenumeration in class.
in class(myclass) logging level:debug | additivity:true | parent:root | getallappenders():nullenumeration log.debug printing nothing console. log4j configuration class
<logger name="com.xxx.service.impl.myclass"> <level value="trace"/> </logger> tried debug why debug message not getting printed in many ways in vain.
how can check log4j configuration class in depth , problem, please me.
at first, u should set additivity parameter false sure each class writing logs 1 log4j file:
log4j.additivity.${appendarname}=false
and make sure 1 log4j tech loaded app(i prefer log4j basic staff)
be sure , no log4j.xml or log4j.properties files under of classpath folders 1 u want loaded. if possiibility, force application use yours. spring:
<bean id="log4jinitializer" class="org.springframework.beans.factory.config.methodinvokingfactorybean" > <property name="staticmethod"> <value>org.springframework.util.log4jconfigurer.initlogging</value> </property> <property name="arguments"> <list> <value>file:${log4jfile}</value> </list> </property> </bean>
Comments
Post a Comment