From f6c5f7a91b341e789435d877b99a4226cf4df506 Mon Sep 17 00:00:00 2001 From: zhaojun1998 Date: Sun, 12 Jan 2020 11:13:02 +0800 Subject: [PATCH] =?UTF-8?q?:wrench:=20=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6,=20=E5=B0=86=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E6=94=B9=E4=B8=BA=E5=8D=95=E7=8B=AC=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application.yml | 10 +-- src/main/resources/logback-spring.xml | 88 +++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 7 deletions(-) create mode 100644 src/main/resources/logback-spring.xml diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 268cc8b..e011af1 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,9 +1,3 @@ -logging: - level: - im: - zhaojun: info - path: ${user.home}/.zfile/logs - server: port: 8080 servlet: @@ -40,10 +34,12 @@ spring: properties: hibernate: format_sql: false - show-sql: true + show-sql: false resources: chain: gzipped: true + profiles: + active: prod zfile: cache: timeout: 300 diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..af5eb0c --- /dev/null +++ b/src/main/resources/logback-spring.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + INFO + + + %clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx} + + + + + + + ${LOG_HOME}/${appName}.log + + + + + ${LOG_HOME}/${appName}-%d{yyyy-MM-dd}-%i.log + + 365 + + + 5MB + + + + + %d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%t] %-40.40logger{39} : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx} + + + + + + + + + + + + + + + + + + + \ No newline at end of file