#1 定義了兩個輸出端 level = LOG,INFO,WARN,ERROR,FATAL
log4j.rootLogger = ERROR, A1, A4
###定義某個包下的所有類錯誤級別
#log4j.logger.net.sf.hibernate=ERROR
log4j.addivity.org.apache=true
#2 定義A1輸出到控制器
log4j.appender.A1 = org.apache.log4j.ConsoleAppender
#3 定義A1的佈局模式?PatternLayout
log4j.appender.A1.layout = org.apache.log4j.PatternLayout
#4 定義A1的輸出格式
log4j.appender.A1.layout.ConversionPattern = %d [%-5p] %C-%M:%L -- %m%n
#5 定義A2輸出到文件
#log4j.appender.A2 = org.apache.log4j.RollingFileAppender
#6 定義A2要輸出到哪一個文件
#log4j.appender.A2.File = D://log4j_roniy.log
#7 定義A2的輸出文件的最大長度
#log4j.appender.A2.MaxFileSize = 500KB
#8 定義A2的備份檔案數
#log4j.appender.A2.MaxBackupIndex = 3
#9 定義A2的佈局模式?PatternLayout
#log4j.appender.A2.layout = org.apache.log4j.PatternLayout
#10 定義A2的輸出格式
#log4j.appender.A2.layout.ConversionPattern = %d{yyyy-MM-dd hh:mm:ss}:%p %t %c - %m%n
#11區 定義A3輸出到資料庫
#log4j.appender.A3 = org.apache.log4j.jdbc.JDBCAppender
#log4j.appender.A3.driver = org.gjt.mm.mysql.Driver
#log4j.appender.A3.URL = jdbc:mysql://localhost:3306/tiandi?useUnicode=true&characterEncoding=GBK
#log4j.appender.A3.user = chengang
#log4j.appender.A3.password = chengang
#log4j.appender.A3.sql = INSERT INTO log4j (create_date, thread, priority, file_name, method, line_number, message) values('%d', '%t', '%-5p', '%C', '%M', '%L', '%m%n')
#log4j.appender.A3.layout = org.apache.log4j.PatternLayout
#log4j.appender.A3.layout.ConversionPattern = %d - %c -%-4r [%t] %-5p %c %x - %m%n
log4j.appender.A4 = org.apache.log4j.RollingFileAppender
log4j.appender.A4.layout = org.apache.log4j.xml.XMLLayout
log4j.appender.A4.append = true
log4j.appender.A4.file = D://LOG4J_log.xml