log4j的配置文件的内容

时间:2022-07-03 21:50:23

注意类的中日志文件的记录:
建议重新配置,没有输出日志文件的 路径
前台的使用方法:

    private static Logger logger = Logger.getLogger(LoginController.class);
log4j.rootLogger=debug, stdout



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.java.sql.ResultSet=DEBUG





log4j.logger.org.springframework=ERROR

log4j.logger.org.compass=ERROR





log4j.appender.stdout=org.apache.log4j.ConsoleAppender

log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n



log4j.appender.logfile=org.apache.log4j.RollingFileAppender

log4j.appender.logfile.File=empi.log

log4j.appender.logfile.MaxFileSize=512KB

log4j.appender.logfile.MaxBackupIndex=3

log4j.appender.logfile.layout=org.apache.log4j.PatternLayout

log4j.appender.logfile.layout.ConversionPattern=%d %p [%c] - %m%n