From 0228eb1590727f1c25772e697ed2e0d7d8db840f Mon Sep 17 00:00:00 2001 From: houjianhui Date: Mon, 9 Oct 2017 13:40:12 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/log4j.properties | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 ils-sales-web/src/main/resources/log4j.properties diff --git a/ils-sales-web/src/main/resources/log4j.properties b/ils-sales-web/src/main/resources/log4j.properties new file mode 100644 index 0000000..4c7d4d8 --- /dev/null +++ b/ils-sales-web/src/main/resources/log4j.properties @@ -0,0 +1,34 @@ +#DEBUG < INFO < WARN < ERROR < FATAL +### set log levels ### +log4j.rootLogger = ERROR,stdout,A1,A2 + +### output log into console ### ##控制台模式 +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 = %-d{yyyy-MM-dd HH\:mm\:ss} [%c\:%M\:%L]-[%p] %m%n + +### output info log into file ### +log4j.appender.A1= org.apache.log4j.DailyRollingFileAppender +log4j.appender.A1.Threshold= INFO +log4j.appender.A1.File= ../logs/ils-sales-web.log +log4j.appender.A1.Append= true +log4j.appender.A1.MaxFileSize= 128MB +log4j.appender.A1.MaxBackupIndex= 500 +log4j.appender.A1.layout= org.apache.log4j.PatternLayout +log4j.appender.A1.layout.ConversionPattern= %-d{yyyy-MM-dd HH\:mm\:ss} [%c\:%M\:%L]-[%p] %m%n + + +### output error log into file ### +log4j.appender.A2= org.apache.log4j.DailyRollingFileAppender +log4j.appender.A2.Threshold= ERROR +log4j.appender.A2.File= ../logs/log4jtest.log +log4j.appender.A2.Append= true +log4j.appender.A2.MaxFileSize= 128MB +log4j.appender.A2.MaxBackupIndex= 500 +log4j.appender.A2.layout= org.apache.log4j.PatternLayout +log4j.appender.A2.layout.ConversionPattern= %-d{yyyy-MM-dd HH\:mm\:ss} [%c\:%M\:%L]-[%p] %m%n + +log4j.logger.org.springframework.aop.framework.Cglib2AopProxy=ERROR +log4j.logger.com.unlcn.ils.sales=ERROR +log4j.logger.org.springframework=ERROR -- Gitee From 075466cc22ee09d28f5275ffc0799c31a4b96f89 Mon Sep 17 00:00:00 2001 From: zhaoguixin <306743062@qq.com> Date: Mon, 9 Oct 2017 14:28:58 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ils-sales-web/pom.xml | 24 +++++++++++++ .../src/main/resources/log4j.properties | 34 ------------------ .../main/resources/logback/local/logback.xml | 32 +++++++++++++++++ .../resources/logback/product/logback.xml | 35 +++++++++++++++++++ pom.xml | 20 +++++++++++ 5 files changed, 111 insertions(+), 34 deletions(-) delete mode 100644 ils-sales-web/src/main/resources/log4j.properties create mode 100644 ils-sales-web/src/main/resources/logback/local/logback.xml create mode 100644 ils-sales-web/src/main/resources/logback/product/logback.xml diff --git a/ils-sales-web/pom.xml b/ils-sales-web/pom.xml index 666d4c3..237f81c 100644 --- a/ils-sales-web/pom.xml +++ b/ils-sales-web/pom.xml @@ -91,4 +91,28 @@ ils-sales-web + + + + dev + + true + + + + + + + pro + + + + + + uat + + + + + diff --git a/ils-sales-web/src/main/resources/log4j.properties b/ils-sales-web/src/main/resources/log4j.properties deleted file mode 100644 index 4c7d4d8..0000000 --- a/ils-sales-web/src/main/resources/log4j.properties +++ /dev/null @@ -1,34 +0,0 @@ -#DEBUG < INFO < WARN < ERROR < FATAL -### set log levels ### -log4j.rootLogger = ERROR,stdout,A1,A2 - -### output log into console ### ##控制台模式 -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 = %-d{yyyy-MM-dd HH\:mm\:ss} [%c\:%M\:%L]-[%p] %m%n - -### output info log into file ### -log4j.appender.A1= org.apache.log4j.DailyRollingFileAppender -log4j.appender.A1.Threshold= INFO -log4j.appender.A1.File= ../logs/ils-sales-web.log -log4j.appender.A1.Append= true -log4j.appender.A1.MaxFileSize= 128MB -log4j.appender.A1.MaxBackupIndex= 500 -log4j.appender.A1.layout= org.apache.log4j.PatternLayout -log4j.appender.A1.layout.ConversionPattern= %-d{yyyy-MM-dd HH\:mm\:ss} [%c\:%M\:%L]-[%p] %m%n - - -### output error log into file ### -log4j.appender.A2= org.apache.log4j.DailyRollingFileAppender -log4j.appender.A2.Threshold= ERROR -log4j.appender.A2.File= ../logs/log4jtest.log -log4j.appender.A2.Append= true -log4j.appender.A2.MaxFileSize= 128MB -log4j.appender.A2.MaxBackupIndex= 500 -log4j.appender.A2.layout= org.apache.log4j.PatternLayout -log4j.appender.A2.layout.ConversionPattern= %-d{yyyy-MM-dd HH\:mm\:ss} [%c\:%M\:%L]-[%p] %m%n - -log4j.logger.org.springframework.aop.framework.Cglib2AopProxy=ERROR -log4j.logger.com.unlcn.ils.sales=ERROR -log4j.logger.org.springframework=ERROR diff --git a/ils-sales-web/src/main/resources/logback/local/logback.xml b/ils-sales-web/src/main/resources/logback/local/logback.xml new file mode 100644 index 0000000..5b76a58 --- /dev/null +++ b/ils-sales-web/src/main/resources/logback/local/logback.xml @@ -0,0 +1,32 @@ + + + + + UTF-8 + + %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n + UTF-8 + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ils-sales-web/src/main/resources/logback/product/logback.xml b/ils-sales-web/src/main/resources/logback/product/logback.xml new file mode 100644 index 0000000..872019e --- /dev/null +++ b/ils-sales-web/src/main/resources/logback/product/logback.xml @@ -0,0 +1,35 @@ + + + + + UTF-8 + ${catalina.base}/logs/sales-web.log + + ${catalina.base}/logs/sales-web.%d{yyyy-MM-dd}.log.zip + + 30 + + + %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n + UTF-8 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 0986755..5f15b48 100644 --- a/pom.xml +++ b/pom.xml @@ -321,6 +321,26 @@ + + + src/main/resources + true + + **/*.properties + + + + src/main/resources + false + + **/*.properties + logback/** + + + + src/main/resources/logback/${label} + + -- Gitee