Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SiEn
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hewei
SiEn
Commits
bb632de4
Commit
bb632de4
authored
Nov 09, 2020
by
zhangjw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1:完善客服模块 日志输出
parent
ad1eaa36
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
119 additions
and
9 deletions
+119
-9
customer-service/src/main/resources/application-test.yml
+9
-9
customer-service/src/main/resources/application.yml
+1
-0
customer-service/src/main/resources/logback-spring.xml
+109
-0
No files found.
customer-service/src/main/resources/application-test.yml
View file @
bb632de4
...
...
@@ -16,21 +16,21 @@ spring:
max-wait
:
60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位毫秒
time-between-eviction-runs-millis
:
60000
url
:
jdbc:mysql://
127.0.0.1
/customer_service?useUnicode=true&useSSL=false&serverTimezone=Asia/Shanghai&characterEncoding=utf8
username
:
web
password
:
wBT7bC9BeUkE
url
:
jdbc:mysql://
47.99.47.225
/customer_service?useUnicode=true&useSSL=false&serverTimezone=Asia/Shanghai&characterEncoding=utf8
username
:
root
password
:
temple123456
driver-class-name
:
com.mysql.cj.jdbc.Driver
connectionInitSqls
:
set names utf8mb4
jackson
:
default-property-inclusion
:
non_null
rabbitmq
:
host
:
127.0.0.1
host
:
47.99.47.225
port
:
5672
username
:
root
password
:
TYWu154pBpvr
staff-offline-Queue-Name
:
staff.offline
password
:
root
order-queue-name
:
push.order
staff-offline-Queue-Name
:
staff.offline
exchange-name
:
delay.exchange
listener
:
simple
:
...
...
@@ -39,7 +39,7 @@ spring:
database
:
0
host
:
127.0.0.1
port
:
6379
password
:
LSlX0JKkD34U3oY3hwI5
password
:
temple123456
# (重要!)设置mvc默认语言为zh_CN,默认语言必须为static.i18n目录下有的语言配置文件,否则跟随服务器语言
mvc
:
locale
:
zh_CN
...
...
@@ -48,4 +48,4 @@ spring:
log-condition-evaluation-delta
:
false
serviceUrl
:
user-info-url
:
http:/127.0.0.1:8889/api/app/user/userInfo
\ No newline at end of file
user-info-url
:
http://47.99.47.225:8889/api/app/user/userInfo
\ No newline at end of file
customer-service/src/main/resources/application.yml
View file @
bb632de4
...
...
@@ -21,6 +21,7 @@ netty:
#日志配置
logging
:
file
:
logs/${spring.application.name}.log
level
:
root
:
info
com.ym.im.mapper
:
debug
...
...
customer-service/src/main/resources/logback-spring.xml
0 → 100755
View file @
bb632de4
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2019-2029 geekidea(https://github.com/geekidea)
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<configuration>
<property
name=
"CONTEXT_NAME"
value=
"customer-service"
/>
<property
name=
"LOG_PATH"
value=
"logs"
/>
<property
name=
"MAX_FILE_SIZE"
value=
"10MB"
/>
<property
name=
"MAX_HISTORY"
value=
"30"
/>
<contextName>
${CONTEXT_NAME}
</contextName>
<!-- 彩色日志 -->
<conversionRule
conversionWord=
"clr"
converterClass=
"org.springframework.boot.logging.logback.ColorConverter"
/>
<conversionRule
conversionWord=
"wex"
converterClass=
"org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"
/>
<conversionRule
conversionWord=
"wEx"
converterClass=
"org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"
/>
<!-- 控制台日志样式 -->
<property
name=
"CONSOLE_LOG_PATTERN"
value=
"${CONSOLE_LOG_PATTERN:-%clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr([%15.15t]){faint} [%X{requestId}] %clr(%-40.40logger{39}){cyan} [%L] %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"
/>
<!-- 文件日志样式 -->
<property
name=
"FILE_LOG_PATTERN"
value=
"${FILE_LOG_PATTERN:-%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} ${LOG_LEVEL_PATTERN:-%5p} [%t] [%X{requestId}] %-40.40logger{39} %L : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"
/>
<!-- 禁用logback自身日志输出 -->
<statusListener
class=
"ch.qos.logback.core.status.NopStatusListener"
/>
<!-- 控制台 -->
<appender
name=
"CONSOLE"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder>
<pattern>
${CONSOLE_LOG_PATTERN}
</pattern>
</encoder>
</appender>
<!-- 运行日志文件 -->
<appender
name=
"FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<encoder>
<pattern>
${FILE_LOG_PATTERN}
</pattern>
</encoder>
<file>
${LOG_PATH}/customer-service.log
</file>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"
>
<fileNamePattern>
${LOG_PATH}/customer-service-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<maxFileSize>
${MAX_FILE_SIZE}
</maxFileSize>
<maxHistory>
${MAX_HISTORY}
</maxHistory>
</rollingPolicy>
</appender>
<!-- 错误日志文件 -->
<appender
name=
"ERROR_FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<encoder>
<pattern>
${FILE_LOG_PATTERN}
</pattern>
</encoder>
<file>
${LOG_PATH}/customer-service-error.log
</file>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"
>
<fileNamePattern>
${LOG_PATH}/customer-service-error-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<maxFileSize>
${MAX_FILE_SIZE}
</maxFileSize>
<maxHistory>
${MAX_HISTORY}
</maxHistory>
</rollingPolicy>
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<level>
ERROR
</level>
<onMatch>
ACCEPT
</onMatch>
<onMismatch>
DENY
</onMismatch>
</filter>
</appender>
<!-- 异步写日志 -->
<appender
name=
"ASYNC_FILE"
class=
"ch.qos.logback.classic.AsyncAppender"
>
<discardingThreshold>
0
</discardingThreshold>
<queueSize>
1024
</queueSize>
<appender-ref
ref=
"FILE"
/>
</appender>
<appender
name=
"ASYNC_ERROR_FILE"
class=
"ch.qos.logback.classic.AsyncAppender"
>
<discardingThreshold>
0
</discardingThreshold>
<queueSize>
1024
</queueSize>
<appender-ref
ref=
"ERROR_FILE"
/>
</appender>
<!-- 不同环境的日志级别配置 -->
<springProfile
name=
"dev"
>
<logger
name=
"io.geekidea.springbootplus"
level=
"DEBUG"
/>
</springProfile>
<!-- 解决SpringBootAdmin错误日志问题 -->
<logger
name=
"org.apache.catalina.connector.CoyoteAdapter"
level=
"OFF"
/>
<root
level=
"INFO"
>
<appender-ref
ref=
"CONSOLE"
/>
<appender-ref
ref=
"ASYNC_FILE"
/>
<appender-ref
ref=
"ASYNC_ERROR_FILE"
/>
</root>
</configuration>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment