logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "流子℡" <41157...@qq.com>
Subject how to filter JakartaCommonsLoggingImpl's print log
Date Thu, 19 Dec 2013 02:38:47 GMT
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?
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message