Commit c4b02f89 authored by Administrator's avatar Administrator

添加修改log4j日志的格式

parent 03b72d27
......@@ -4,7 +4,7 @@ server:
spring:
datasource:
driver-class-name: oracle.jdbc.driver.OracleDriver
url: jdbc:oracle:thin:@192.168.10.208:1521:yingxin
url: jdbc:oracle:thin:@192.168.10.65:1521:yingxin
username: yingxin
password: yingxin
servlet:
......
### 设置###
log4j.rootLogger = debug,stdout,D,E
log4j.appenderRefs = ${appenders}
log4j.appenderRef.console.ref = STDOUT
log4j.appenderRef.rollingFileAppender.ref = rollingFile
### 输出信息到控制台 ###
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target = System.out
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern = [%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} method:%l%n%m%n
### 输出DEBUG 级别以上的日志到=E://logs/error.log ###
log4j.appender.D = org.apache.log4j.DailyRollingFileAppender
log4j.appender.D.File = ./logs/debug.log
log4j.appender.D.Append = true
log4j.appender.D.Threshold = DEBUG
log4j.appender.D.layout = org.apache.log4j.PatternLayout
log4j.appender.D.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [%X{ip}] [ %t:%r ] - [ %p ] %l %m%n
### 输出ERROR 级别以上的日志到=E://logs/error.log ###
log4j.appender.E = org.apache.log4j.DailyRollingFileAppender
log4j.appender.E.File =./logs/error.log
log4j.appender.E.Append = true
log4j.appender.E.Threshold = ERROR
log4j.appender.E.layout = org.apache.log4j.PatternLayout
log4j.appender.E.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [%X{ip}] [ %t:%r ] - [ %p ] %l %m%n
###打印SQL###
log4j.logger.org.mybatis = DEBUG
log4j.logger.java.sql = DEBUG
log4j.logger.java.sql.Statement = DEBUG
log4j.logger.java.sql.ResultSet = DEBUG
log4j.logger.java.sql.PreparedStatement = DEBUG
### druid sql ###
log4j.logger.D.sql=stdout
log4j.logger.D.sql.DataSource=stdout
log4j.logger.D.sql.Connection=stdout
log4j.logger.D.sql.Statement=stdout
log4j.logger.D.sql.ResultSet=stdout
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment