log4j级别设置问题
配置文件设置为WARN的时候:
public String create()throws Exception { try { logger.warn("添加企业信息"); enterpriseServiceDAO.Create(enterprise); logger.info("添加企业信息11"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); logger.error("企业信息添加失败!"); return "input"; } return "create"; }
log4j.rootLogger=INFO,dblog4j.appender.db=org.apache.log4j.jdbc.JDBCAppenderlog4j.appender.db.BufferSize=10log4j.appender.db.URL=jdbc\:jtds\:sqlserver\://server\:1434/pcbsynlog4j.appender.db.driver=net.sourceforge.jtds.jdbc.Driverlog4j.appender.db.user=salog4j.appender.db.password=711log4j.appender.db.sql=insert into logInfo(userId,userName,lclass,lmethod,lTime,llevel,message) values ('%X{userId}','%X{userName}','%C','%M','%d{yyyy-MM-dd HH\:mm\:ss}','%p','%m')log4j.appender.db.layout=org.apache.log4j.PatternLayout