pom.xml下加入
<properties>
.version>
<slf4j.version>1.6.1</slf4j.version>
<log4j.version>1.2.16</log4j.version>
</properties
<!-- LOGGING begin -->
<!-- slf4j -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<!-- slf4j-log4j绑定 -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<!-- common-logging 实际调用slf4j -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>
<!-- java.util.logging 实际调用slf4j -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>
<!-- log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<!-- LOGGING end -->
<!-- slf4j bound to Log4j end -->
在maven项目src/main/resource木下加加入
log4j.properties
log4j.rootLogger=INFO, Console
log4j.logger.azkaban.webapp=INFO, WebServer
log4j.logger.azkaban.webapp.servlet.AbstractAzkabanServlet=INFO, R
log4j.logger.azkaban.webapp.servlet.LoginAbstractAzkabanServlet=INFO, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.File=azkaban-access.log
log4j.appender.R.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS Z} %p [%c{1}] [Azkaban] %m%n
log4j.appender.R.MaxFileSize=102400MB
log4j.appender.R.MaxBackupIndex=2
log4j.appender.WebServer=org.apache.log4j.RollingFileAppender
log4j.appender.WebServer.layout=org.apache.log4j.PatternLayout
log4j.appender.WebServer.File=azkaban-webserver.log
log4j.appender.WebServer.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS Z} %p [%c{1}] [Azkaban] %m%n
log4j.appender.WebServer.MaxFileSize=102400MB
log4j.appender.WebServer.MaxBackupIndex=2
log4j.appender.ExecServer=org.apache.log4j.RollingFileAppender
log4j.appender.ExecServer.layout=org.apache.log4j.PatternLayout
log4j.appender.ExecServer.File=azkaban-execserver.log
log4j.appender.ExecServer.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS Z} %p [%c{1}] [Azkaban] %m%n
log4j.appender.ExecServer.MaxFileSize=102400MB
log4j.appender.ExecServer.MaxBackupIndex=2
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS Z} %p [%c{1}] [Azkaban] %m%n
log4j.logger.com.ibatis=DEBUG
log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG
log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG
log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG
log4j.logger.java.sql.Connection=DEBUG
log4j.logger.java.sql.Statement=DEBUG
log4j.logger.java.sql.PreparedStatement=DEBUG
log4j.logger.com.XXX.dao=DEBUG