Log4j in class not work in jsp page -


log4j.properties

log4j.rootlogger=on, a1 log4j.logger.org.apache.jsp=debug log4j.appender.a1=org.apache.log4j.fileappender log4j.appender.a1.file=test.log log4j.appender.a1.layout=org.apache.log4j.patternlayout log4j.appender.a1.layout.conversionpattern=[%d{yyyy-mm-dd hh:mm:ss}] - %m%n  

test.java

package ch15; import org.apache.log4j.logger;  public class test {     static logger logger = logger.getlogger(test.class);     public static void main(string[] args)     {         makelog();     }      public static string makelog()     {         logger.debug("test");         return "yes";     } }     

when compile java file , execute, log file created normally.

[2013-05-10 16:53:24] - test 

but when intend use class file in jsp below, there's no log @ all.

<jsp:usebean id="t" class="ch15.test" /> <%=t.makelog()%> 

i think jsp call test class because browser displays "yes".

but no log written...

can me? i'm in trouble week...:(


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -