I'm honestly wondering why you're not just using log4j-jcl. And besides
that, you'd be far better off just extending AbstractLogger or
AbstractLoggerWrapper as it does the logging level checks that you forgot
to implement. The way you have it, your log4j2.xml file won't affect JCL at
all. Instead, JCL will depend on your system properties set for JCL.


On 18 December 2013 20:38, 流子℡ <41157...@qq.com> wrote:

> hi,all,      I meet a problem that
> com.ibatis.common.logging.jakarta.JakartaCommonsLoggingImpl's debug log
> can't be filtered,in log4j2.xml ,I have configured as follows:
> <logger name="com.ibatis.common" level="warn">
> </logger>
>
>
>
> but in console,the log still printed as this:
> .......
> 2013-12-19 10:25:27.695 DEBUG [main][JakartaCommonsLoggingImpl.java:27] -
> {conn-100143} Connection
> 2013-12-19 10:25:27.695 DEBUG [main][JakartaCommonsLoggingImpl.java:27] -
> {conn-100143} Preparing Statement:    update id_gen    set     value =
> value + 1          where id = ?
> 2013-12-19 10:25:27.696 DEBUG [main][JakartaCommonsLoggingImpl.java:27] -
> {pstm-100144} Executing Statement:    update id_gen    set     value =
> value + 1          where id = ?
> 2013-12-19 10:25:27.696 DEBUG [main][JakartaCommonsLoggingImpl.java:27] -
> {pstm-100144} Parameters: [33d39b36-1db7-471d-b034-56fba8d5229d]
>
>
>
> .....
>
>
> the class 's source code as follows:
> package com.ibatis.common.logging.jakarta;
>
>
> import com.ibatis.common.logging.Log;
> import org.apache.commons.logging.LogFactory;
>
>
> public class JakartaCommonsLoggingImpl
>     implements Log
> {
>
>
>     public JakartaCommonsLoggingImpl(Class clazz)
>     {
>         log = LogFactory.getLog(clazz);
>     }
>
>
>     public boolean isDebugEnabled()
>     {
>         return log.isDebugEnabled();
>     }
>
>
>     public void error(String s, Throwable e)
>     {
>         log.error(s, e);
>     }
>
>
>     public void error(String s)
>     {
>         log.error(s);
>     }
>
>
>     public void debug(String s)
>     {
>         log.debug(s);
>     }
>
>
>     public void warn(String s)
>     {
>         log.warn(s);
>     }
>
>
>     private org.apache.commons.logging.Log log;
> }
>
>
>
>
>
> it looks so stranger,however other filter seems OK,for instance ,
> <logger name="org.springframework" level="info">
> </logger>
> <logger name="org.jboss.netty" level="warn">
> </logger>
>
>
>
> how to fix this problem?




-- 
Matt Sicker <boa...@gmail.com>

Reply via email to