Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
education
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李丛阳
education
Commits
955353e3
Commit
955353e3
authored
Mar 17, 2020
by
luzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nacos
parent
f03bdf7b
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
235 additions
and
451 deletions
+235
-451
Dockerfile
Dockerfile
+1
-1
spcl-edu-dev.yml
nacos_config/dev/spcl-edu-dev.yml
+34
-42
spcl-edu-dev.yml
nacos_config/lz_test/spcl-edu-dev.yml
+60
-50
CyServiceAuthConfig.java
...ava/org/rcisoft/core/auth/config/CyServiceAuthConfig.java
+2
-0
application-dev.yml
src/main/resources/application-dev.yml
+0
-113
application-prod.yml
src/main/resources/application-prod.yml
+0
-117
application.yml
src/main/resources/application.yml
+0
-8
bootstrap.yml
src/main/resources/bootstrap.yml
+18
-0
logback-spring.back
src/main/resources/logback-spring.back
+0
-89
logback-spring.xml
src/main/resources/logback-spring.xml
+80
-31
logback-spring.xml.back
src/main/resources/logback-spring.xml.back
+40
-0
No files found.
Dockerfile
View file @
955353e3
...
@@ -2,7 +2,7 @@ FROM java:8
...
@@ -2,7 +2,7 @@ FROM java:8
ENV
BASE_NAME zx-education
ENV
BASE_NAME zx-education
WORKDIR
/$BASE_NAME
WORKDIR
/$BASE_NAME
COPY
target/$BASE_NAME-1.0.0.jar /$BASE_NAME/$BASE_NAME.jar
COPY
target/$BASE_NAME-1.0.0.jar /$BASE_NAME/$BASE_NAME.jar
COPY
src/main/resources/logback-spring.xml /$BASE_NAME/config/logback-spring.xml
COPY
src/main/resources/logback-spring.xml
.back
/$BASE_NAME/config/logback-spring.xml
ENV
LANG C.UTF-8
ENV
LANG C.UTF-8
ENV
TZ=Asia/Shanghai
ENV
TZ=Asia/Shanghai
RUN
ln
-snf
/usr/share/zoneinfo/
$TZ
/etc/localtime
&&
echo
$TZ
>
/etc/timezone
RUN
ln
-snf
/usr/share/zoneinfo/
$TZ
/etc/localtime
&&
echo
$TZ
>
/etc/timezone
...
...
src/main/resources/application-mt
.yml
→
nacos_config/dev/spcl-edu-dev
.yml
View file @
955353e3
...
@@ -8,44 +8,27 @@ server:
...
@@ -8,44 +8,27 @@ server:
type
:
mt
type
:
mt
maxHttpHeaderSize
:
102400
maxHttpHeaderSize
:
102400
#logging:
# level:
# root: INFO
# org.springframework.web: DEBUG
#druid:
## url: jdbc:mysql://192.168.5.201:20001/edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
# url: jdbc:mysql://mt_mysql:3306/edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
# username: root
# password: 91isoft
# initial-size: 1
# min-idle: 1
# max-active: 20
# test-on-borrow: true
#
mybatis
:
mapper-locations
:
classpath:mapper/**/**/*.xml
mapper
:
mappers
:
-
org.rcisoft.core.base.BaseMapper
not-empty
:
false
identity
:
MYSQL
pagehelper
:
pagehelper
:
helperDialect
:
mysql
helperDialect
:
mysql
reasonable
:
true
reasonable
:
true
supportMethodsArguments
:
true
supportMethodsArguments
:
true
params
:
count=countSql
params
:
count=countSql
spring
:
spring
:
cloud
:
nacos
:
discovery
:
server-addr
:
${spring.cloud.nacos.config.server-addr}
namespace
:
c3c246fa-8ede-475d-a684-1c4c6c47fae1
locator
:
enabled
:
true
lowerCaseServiceId
:
true
application
:
name
:
spcl-edu
datasource
:
datasource
:
url
:
jdbc:mysql://
mt_mysql:3306
/edu_db?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&serverTimezone=GMT%2B8
url
:
jdbc:mysql://
${MYSQL_HOST:127.0.0.1}:${MYSQL_PORT:3306}
/edu_db?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&serverTimezone=GMT%2B8
username
:
root
username
:
root
password
:
91isof
t
password
:
roo
t
type
:
com.zaxxer.hikari.HikariDataSource
type
:
com.zaxxer.hikari.HikariDataSource
driver-class-name
:
com.mysql.cj.jdbc.Driver
driver-class-name
:
com.mysql.cj.jdbc.Driver
jackson
:
jackson
:
...
@@ -64,8 +47,16 @@ spring:
...
@@ -64,8 +47,16 @@ spring:
multipart
:
multipart
:
max-file-size
:
100MB
max-file-size
:
100MB
max-request-size
:
100MB
max-request-size
:
100MB
application
:
name
:
zx-education
auth
:
serviceId
:
spcl-auth-server
user
:
token-header
:
Authorization
token-prefix
:
"
Bearer
"
client
:
id
:
spcl-edu
#不填则默认读取spring.application.name
secret
:
123456
token-header
:
x-client-token
global
:
global
:
lk
:
lk
:
...
@@ -111,22 +102,23 @@ deleteZipJob:
...
@@ -111,22 +102,23 @@ deleteZipJob:
taskInterval
:
0 0 2 * * ?
#执行时间 默认每天凌晨2点执行
taskInterval
:
0 0 2 * * ?
#执行时间 默认每天凌晨2点执行
openTask
:
true
#删除文件定时任务是否开启
openTask
:
true
#删除文件定时任务是否开启
mybatis
:
mapper-locations
:
classpath:mapper/**/**/*.xml
mapper
:
mappers
:
-
org.rcisoft.core.base.BaseMapper
not-empty
:
false
identity
:
MYSQL
libreoffice
:
libreoffice
:
ip
:
mt_libre
ip
:
mt_libre
port
:
8997
port
:
8997
mt
:
mt
:
api
:
http://192.168.5.201/api/
api
:
http://192.168.5.201/api/
# api: http://221.239.114.20:6789/api/
eureka
:
instance
:
# hostname: localhost
prefer-ip-address
:
true
ip-address
:
192.168.5.201
client
:
register-with-eureka
:
true
fetch-registry
:
true
service-url
:
defaultZone
:
http://zx:zgiot@192.168.5.48:7001/eureka
ribbon
:
ribbon
:
ReadTimeout
:
10000
ReadTimeout
:
10000
ConnectTimeout
:
10000
ConnectTimeout
:
10000
...
...
src/main/resources/application-test
.yml
→
nacos_config/lz_test/spcl-edu-dev
.yml
View file @
955353e3
...
@@ -5,47 +5,30 @@ server:
...
@@ -5,47 +5,30 @@ server:
servlet
:
servlet
:
context-path
:
/
context-path
:
/
#uri-encoding: UTF-8
#uri-encoding: UTF-8
type
:
tes
t
type
:
m
t
maxHttpHeaderSize
:
102400
maxHttpHeaderSize
:
102400
#logging:
# level:
# root: INFO
# org.springframework.web: DEBUG
#
#druid:
## url: jdbc:mysql://192.168.5.201:20001/edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
# url: jdbc:mysql://192.168.5.41:3306/zx_education?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
# username: edu
# password: edu20191127
# initial-size: 1
# min-idle: 1
# max-active: 20
# test-on-borrow: true
mybatis
:
mapper-locations
:
classpath:mapper/**/**/*.xml
mapper
:
mappers
:
-
org.rcisoft.core.base.BaseMapper
not-empty
:
false
identity
:
MYSQL
pagehelper
:
pagehelper
:
helperDialect
:
mysql
helperDialect
:
mysql
reasonable
:
true
reasonable
:
true
supportMethodsArguments
:
true
supportMethodsArguments
:
true
params
:
count=countSql
params
:
count=countSql
spring
:
spring
:
cloud
:
nacos
:
discovery
:
server-addr
:
${spring.cloud.nacos.config.server-addr}
namespace
:
c3c246fa-8ede-475d-a684-1c4c6c47fae1
locator
:
enabled
:
true
lowerCaseServiceId
:
true
application
:
name
:
spcl-edu
datasource
:
datasource
:
url
:
jdbc:mysql://
192.168.5.41:3306/zx_education
?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&serverTimezone=GMT%2B8
url
:
jdbc:mysql://
${MYSQL_HOST:127.0.0.1}:${MYSQL_PORT:3306}/edu_db
?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&serverTimezone=GMT%2B8
username
:
edu
username
:
root
password
:
edu20191127
password
:
root
type
:
com.zaxxer.hikari.HikariDataSource
type
:
com.zaxxer.hikari.HikariDataSource
driver-class-name
:
com.mysql.cj.jdbc.Driver
driver-class-name
:
com.mysql.cj.jdbc.Driver
jackson
:
jackson
:
...
@@ -64,8 +47,16 @@ spring:
...
@@ -64,8 +47,16 @@ spring:
multipart
:
multipart
:
max-file-size
:
100MB
max-file-size
:
100MB
max-request-size
:
100MB
max-request-size
:
100MB
application
:
name
:
zx-education
auth
:
serviceId
:
spcl-auth-server
user
:
token-header
:
Authorization
token-prefix
:
"
Bearer
"
client
:
id
:
spcl-edu
#不填则默认读取spring.application.name
secret
:
123456
token-header
:
x-client-token
global
:
global
:
lk
:
lk
:
...
@@ -91,39 +82,58 @@ global:
...
@@ -91,39 +82,58 @@ global:
pdf_location
:
pdf
pdf_location
:
pdf
cut_pdf_location
:
cutPdf
cut_pdf_location
:
cutPdf
cource_logo_location
:
/course/logo
cource_logo_location
:
/course/logo
zip_location
:
zip
other
:
other
:
is_server_linux
:
5
is_server_linux
:
5
cut_pdf_num
:
30
cut_pdf_num
:
30
eduJob
:
eduJob
:
taskInterval
:
0 0/5 * * * ?
taskInterval
:
0 0/5 * * * ?
trainBegin
:
true
trainBegin
:
true
#培训设置为缺勤定时任务
sec
:
300
#培训结束后 多少秒 之内的报名人员设置为缺勤
sec
:
300
#培训结束后 多少秒 之内的报名人员设置为缺勤
messageTask
:
true
messageTask
:
true
#发送通知定时任务
deleteFileJob
:
taskInterval
:
0 0 2 * * ?
#执行时间 默认每天凌晨2点执行
delFlag
:
0
#0仅删除mp4 mp3(默认) 1删除全部
openTask
:
true
#删除文件定时任务是否开启
deleteZipJob
:
taskInterval
:
0 0 2 * * ?
#执行时间 默认每天凌晨2点执行
openTask
:
true
#删除文件定时任务是否开启
mybatis
:
mapper-locations
:
classpath:mapper/**/**/*.xml
mapper
:
mappers
:
-
org.rcisoft.core.base.BaseMapper
not-empty
:
false
identity
:
MYSQL
libreoffice
:
libreoffice
:
ip
:
mt_libre
ip
:
mt_libre
port
:
8997
port
:
8997
mt
:
mt
:
api
:
http://192.168.5.201/api/
api
:
http://192.168.5.201/api/
# api: http://221.239.114.20:6789/api/
eureka
:
instance
:
# hostname: localhost
prefer-ip-address
:
true
ip-address
:
192.168.5.201
client
:
register-with-eureka
:
true
fetch-registry
:
true
service-url
:
defaultZone
:
http://zx:zgiot@192.168.5.48:7001/eureka
ribbon
:
ribbon
:
ReadTimeout
:
10000
ReadTimeout
:
10000
ConnectTimeout
:
10000
ConnectTimeout
:
10000
notice
:
notice
:
properties
:
properties
:
urlCourse
:
http://192.168.5.54/education-mobile/#/courseDetail?
urlCourse
:
http://192.168.9.39:8001/#/courseDetail?
urlTrain
:
http://192.168.5.54/education-mobile/#/trainDetail?
urlTrain
:
http://192.168.9.39:8001/#/trainDetail?
urlExam
:
http://192.168.5.54/education-mobile/#/onlineExamination?
urlExam
:
http://192.168.9.39:8001/#/onlineExamination?
defaultUrl
:
http://zx-zgiot-002.oss-cn-qingdao.aliyuncs.com/image/2d60950fefa14041b4d9715a70a7d389.png
defaultUrl
:
http://zx-zgiot-002.oss-cn-qingdao.aliyuncs.com/image/c0318e3ee7c6480db013871cd3166e5c.png
\ No newline at end of file
appId
:
globalAppId
:
1
noticeAppId
:
9
upload
:
fileMaxSize
:
500
fileMaxPages
:
500
src/main/java/org/rcisoft/core/auth/config/CyServiceAuthConfig.java
View file @
955353e3
...
@@ -4,6 +4,7 @@ import lombok.AllArgsConstructor;
...
@@ -4,6 +4,7 @@ import lombok.AllArgsConstructor;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
/**
/**
* Created with family.
* Created with family.
...
@@ -15,6 +16,7 @@ import org.springframework.beans.factory.annotation.Value;
...
@@ -15,6 +16,7 @@ import org.springframework.beans.factory.annotation.Value;
@Data
@Data
@AllArgsConstructor
@AllArgsConstructor
@NoArgsConstructor
@NoArgsConstructor
@Component
public
class
CyServiceAuthConfig
{
public
class
CyServiceAuthConfig
{
private
byte
[]
pubKeyByte
;
private
byte
[]
pubKeyByte
;
...
...
src/main/resources/application-dev.yml
deleted
100644 → 0
View file @
f03bdf7b
server
:
port
:
8081
tomcat
:
max-threads
:
300
servlet
:
context-path
:
/
#uri-encoding: UTF-8
type
:
dev
maxHttpHeaderSize
:
102400
#logging:
# level:
# root: INFO
# org.springframework.web: DEBUG
druid
:
url
:
jdbc:mysql://127.0.0.1:3306/edu_db1?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
# url: jdbc:mysql://10.96.131.16:55558/edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
#url: jdbc:mysql://120.52.179.75:13318/edu_db?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
username
:
root
# password: 91isoft
password
:
root
# password: 123456
initial-size
:
1
min-idle
:
1
max-active
:
20
test-on-borrow
:
true
mybatis
:
mapper-locations
:
classpath:mapper/**/**/*.xml
mapper
:
mappers
:
-
org.rcisoft.core.base.BaseMapper
not-empty
:
false
identity
:
MYSQL
pagehelper
:
helperDialect
:
mysql
reasonable
:
true
supportMethodsArguments
:
true
params
:
count=countSql
spring
:
jackson
:
default-property-inclusion
:
non_null
date-format
:
yyyy-MM-dd
time-zone
:
GMT+8
mvc
:
throw-exception-if-no-handler-found
:
true
resources
:
add-mappings
:
false
freemarker
:
charset
:
UTF-8
suffix
:
.ftl
template-loader-path
:
classpath:/templates/
servlet
:
multipart
:
max-file-size
:
100MB
max-request-size
:
100MB
application
:
name
:
zx-education
global
:
lk
:
publicalias
:
publiccert
storePwd
:
rcrtcyedu2
subject
:
edu2
licPath
:
/lk/license.lic
pubPath
:
/lk/publicCerts.store
path
:
base_upload_server_location
:
E:/eduServer
return_upload_server_location
:
http://192.168.5.201:18080/eduServer/
return_upload_server_NOTIP_location
:
eduServer/
course_location
:
course
lesson_location
:
lesson
user_download
:
userDownload
sl_location
:
sl
image_location
:
/upload
video_location
:
video
audio_location
:
audio
temp_location
:
temp
file_location
:
file
ppt_location
:
ppt
pdf_location
:
pdf
cut_pdf_location
:
cutPdf
cource_logo_location
:
/course/logo
return_upload_server_location
:
http://192.168.5.201:18080/eduServer/
other
:
is_server_linux
:
5
cut_pdf_num
:
30
libreoffice
:
ip
:
192.168.1.125
port
:
8997
mt
:
# api: http://192.168.5.41/api/
api
:
http://221.239.114.20:6789/api/
eduJob
:
taskInterval
:
0/30 * * * * ?
trainBegin
:
true
sec
:
300
#培训开始前 多少秒 之内的报名人员设置为缺勤
eureka
:
instance
:
hostname
:
localhost
client
:
register-with-eureka
:
false
fetch-registry
:
false
\ No newline at end of file
src/main/resources/application-prod.yml
deleted
100644 → 0
View file @
f03bdf7b
server
:
port
:
8081
tomcat
:
max-threads
:
300
servlet
:
context-path
:
/
#uri-encoding: UTF-8
type
:
prod
#logging:
# level:
# root: INFO
# org.springframework.web: DEBUG
druid
:
url
:
jdbc:mysql://192.168.5.47:3306/edu_db?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&useSSL=false
username
:
root
password
:
123456
initial-size
:
1
min-idle
:
1
max-active
:
20
test-on-borrow
:
true
mybatis
:
mapper-locations
:
classpath:mapper/**/**/*.xml
mapper
:
mappers
:
-
org.rcisoft.core.base.BaseMapper
not-empty
:
false
identity
:
MYSQL
pagehelper
:
helperDialect
:
mysql
reasonable
:
true
supportMethodsArguments
:
true
params
:
count=countSql
spring
:
jackson
:
default-property-inclusion
:
non_null
date-format
:
yyyy-MM-dd
time-zone
:
GMT+8
mvc
:
throw-exception-if-no-handler-found
:
true
resources
:
add-mappings
:
false
freemarker
:
charset
:
UTF-8
suffix
:
.ftl
template-loader-path
:
classpath:/templates/
servlet
:
multipart
:
max-file-size
:
100MB
max-request-size
:
100MB
application
:
name
:
zx-education
global
:
lk
:
publicalias
:
publiccert
storePwd
:
rcrtcyedu2
subject
:
edu2
licPath
:
/lk/license.lic
pubPath
:
/lk/publicCerts.store
path
:
base_upload_server_location
:
/working/resource/eduServer/
return_upload_server_location
:
http://192.168.5.201:18080/eduServer/
return_upload_server_NOTIP_location
:
eduServer/
course_location
:
course
lesson_location
:
lesson
user_download
:
userDownload
sl_location
:
sl
image_location
:
/upload
video_location
:
video
audio_location
:
audio
temp_location
:
temp
file_location
:
file
ppt_location
:
ppt
pdf_location
:
pdf
cut_pdf_location
:
cutPdf
cource_logo_location
:
/course/logo
other
:
is_server_linux
:
5
cut_pdf_num
:
30
eduJob
:
taskInterval
:
0 0/5 * * * ?
trainBegin
:
flase
sec
:
300
#培训开始前 多少秒 之内的报名人员设置为缺勤
libreoffice
:
ip
:
192.168.1.125
port
:
8997
mt
:
api
:
http://192.168.5.47/api/
eureka
:
instance
:
hostname
:
localhost
prefer-ip-address
:
true
client
:
register-with-eureka
:
true
fetch-registry
:
true
service-url
:
defaultZone
:
http://zx:zgiot@192.168.5.48:7001/eureka
ribbon
:
ReadTimeout
:
10000
ConnectTimeout
:
10000
notice
:
properties
:
urlCourse
:
http://192.168.9.39:8001/#/courseDetail?
urlTrain
:
http://192.168.9.39:8001/#/trainDetail?
urlExam
:
http://192.168.9.39:8001/#/onlineExamination?
\ No newline at end of file
src/main/resources/application.yml
deleted
100644 → 0
View file @
f03bdf7b
spring
:
profiles
:
# active: dev
# active: mtzql
# active: prod
# active: edu
# active: mt
active
:
test
\ No newline at end of file
src/main/resources/bootstrap.yml
0 → 100644
View file @
955353e3
spring
:
cloud
:
nacos
:
config
:
file-extension
:
yml
#server-addr: nacos.91isoft.com:8848
server-addr
:
nacos-standalone-mysql:8848
group
:
spcl
# namespace: 9ebb2311-3fda-4345-ac36-ace4cd5c7d55
namespace
:
c3c246fa-8ede-475d-a684-1c4c6c47fae1
#ext-config[0].data-id: spcl-common-test.properties
#ext-config[0].refresh: true
application
:
name
:
spcl-edu
profiles
:
active
:
dev
main
:
allow-bean-definition-overriding
:
true
\ No newline at end of file
src/main/resources/logback-spring.back
deleted
100644 → 0
View file @
f03bdf7b
<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
<appender
name=
"consoleLog"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<layout
class=
"ch.qos.logback.classic.PatternLayout"
>
<pattern>
%white(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{10}.%M.%L) - %cyan(%msg%n)
</pattern>
<!--<pattern>
%-5level %d - %msg%n
</pattern>-->
</layout>
</appender>
<appender
name=
"fileInfoLog"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<level>
info
</level>
<onMatch>
DENY
</onMatch>
<onMismatch>
ACCEPT
</onMismatch>
</filter>
<encoder>
<pattern>
%date %-5level [%thread] %logger{43}\(%L\) : %msg
</pattern>
</encoder>
<!--滚动策略-->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!--路径-->
<fileNamePattern>
/working/test/info_edu.%d.log
</fileNamePattern>
</rollingPolicy>
</appender>
<!--https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx50601fe1a9207d84&redirect_uri=http://gwf.natapp4.cc/sell/weixin/auth&response_type=code&scope=snsapi_userinfo&state=gwf#wechat_redirect-->
<appender
name=
"fileErrorLog"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!--
临界值过滤器,过滤掉低于指定临界值的日志。当日志级别等于或高于临界值时,过滤器返回NEUTRAL;当日志级别低于临界值时,日志会被拒绝
-->
<filter
class=
"ch.qos.logback.classic.filter.ThresholdFilter"
>
<level>
ERROR
</level>
</filter>
<encoder>
<pattern>
%date %-5level [%thread] %logger{43}\(%L\) : %msg
</pattern>
</encoder>
<!--滚动策略-->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!--路径-->
<fileNamePattern>
/working/test/error_edu.%d.log
</fileNamePattern>
</rollingPolicy>
</appender>
<!--
指定对应包名
-->
<logger
name=
"com.minlia"
level=
"DEBUG"
/>
<logger
name=
"org.springframework.data.mybatis"
level=
"DEBUG"
/>
<logger
name=
"org.springframework.aop.aspectj"
level=
"ERROR"
/>
<springProfile
name=
"dev"
>
<root
level=
"debug"
>
<appender-ref
ref=
"consoleLog"
/>
<appender-ref
ref=
"fileInfoLog"
/>
<appender-ref
ref=
"fileErrorLog"
/>
</root>
</springProfile>
<springProfile
name=
"prod"
>
<root
level=
"debug"
>
<appender-ref
ref=
"consoleLog"
/>
<appender-ref
ref=
"fileInfoLog"
/>
<appender-ref
ref=
"fileErrorLog"
/>
</root>
</springProfile>
<springProfile
name=
"mt"
>
<root
level=
"debug"
>
<appender-ref
ref=
"consoleLog"
/>
<appender-ref
ref=
"fileInfoLog"
/>
<appender-ref
ref=
"fileErrorLog"
/>
</root>
</springProfile>
<springProfile
name=
"mtzql"
>
<root
level=
"debug"
>
<appender-ref
ref=
"consoleLog"
/>
<appender-ref
ref=
"fileInfoLog"
/>
<appender-ref
ref=
"fileErrorLog"
/>
</root>
</springProfile>
</configuration>
\ No newline at end of file
src/main/resources/logback-spring.xml
View file @
955353e3
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<configuration
scan=
"true"
scanPeriod=
"30 seconds"
debug=
"false"
>
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
<configuration>
<property
name=
"LOG_HOME"
value=
"./logs"
/>
<!-- 控制台输出 -->
<appender
name=
"consoleLog"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<layout
class=
"ch.qos.logback.classic.PatternLayout"
>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<pattern>
%white(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{10}.%M.%L) - %cyan(%msg%n)
</pattern>
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<!--<pattern>
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n
</pattern>
%-5level %d - %msg%n
</encoder>
</pattern>-->
</layout>
</appender>
</appender>
<!-- 按照每天生成日志文件 -->
<appender
name=
"FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<appender
name=
"fileInfoLog"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<filter
class=
"ch.qos.logback.classic.filter.LevelFilter"
>
<level>
info
</level>
<onMatch>
DENY
</onMatch>
<onMismatch>
ACCEPT
</onMismatch>
</filter>
<encoder>
<pattern>
%date %-5level [%thread] %logger{43}\(%L\) : %msg
</pattern>
</encoder>
<!--滚动策略-->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!--日志文件输出的文件名-->
<!--路径-->
<FileNamePattern>
${LOG_HOME}/EDUCATION.log.%d{yyyy-MM-dd}.log
</FileNamePattern>
<fileNamePattern>
/working/test/info_edu.%d.log
</fileNamePattern>
<!--日志文件保留天数-->
<MaxHistory>
30
</MaxHistory>
<!--<MaxFileSize>2 KB</MaxFileSize>-->
</rollingPolicy>
</rollingPolicy>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n
</pattern>
</encoder>
</appender>
</appender>
<!--https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx50601fe1a9207d84&redirect_uri=http://gwf.natapp4.cc/sell/weixin/auth&response_type=code&scope=snsapi_userinfo&state=gwf#wechat_redirect-->
<appender
name=
"fileErrorLog"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!--
临界值过滤器,过滤掉低于指定临界值的日志。当日志级别等于或高于临界值时,过滤器返回NEUTRAL;当日志级别低于临界值时,日志会被拒绝
-->
<filter
class=
"ch.qos.logback.classic.filter.ThresholdFilter"
>
<level>
ERROR
</level>
</filter>
<encoder>
<pattern>
%date %-5level [%thread] %logger{43}\(%L\) : %msg
</pattern>
</encoder>
<!--滚动策略-->
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!--路径-->
<fileNamePattern>
/working/test/error_edu.%d.log
</fileNamePattern>
</rollingPolicy>
</appender>
<!--
指定对应包名
-->
<logger
name=
"com.minlia"
level=
"DEBUG"
/>
<logger
name=
"org.springframework.data.mybatis"
level=
"DEBUG"
/>
<logger
name=
"org.springframework.aop.aspectj"
level=
"ERROR"
/>
<!--myibatis log configure-->
<springProfile
name=
"dev"
>
<logger
name=
"com.apache.ibatis"
level=
"TRACE"
/>
<root
level=
"debug"
>
<logger
name=
"java.sql.Connection"
level=
"DEBUG"
/>
<appender-ref
ref=
"consoleLog"
/>
<logger
name=
"java.sql.Statement"
level=
"DEBUG"
/>
<appender-ref
ref=
"fileInfoLog"
/>
<logger
name=
"java.sql.PreparedStatement"
level=
"DEBUG"
/>
<appender-ref
ref=
"fileErrorLog"
/>
</root>
</springProfile>
<!-- 日志输出级别 -->
<springProfile
name=
"prod"
>
<root
level=
"DEBUG"
>
<root
level=
"debug"
>
<appender-ref
ref=
"STDOUT"
/>
<appender-ref
ref=
"consoleLog"
/>
<appender-ref
ref=
"FILE"
/>
<appender-ref
ref=
"fileInfoLog"
/>
</root>
<appender-ref
ref=
"fileErrorLog"
/>
</root>
</springProfile>
<springProfile
name=
"mt"
>
<root
level=
"debug"
>
<appender-ref
ref=
"consoleLog"
/>
<appender-ref
ref=
"fileInfoLog"
/>
<appender-ref
ref=
"fileErrorLog"
/>
</root>
</springProfile>
<springProfile
name=
"mtzql"
>
<root
level=
"debug"
>
<appender-ref
ref=
"consoleLog"
/>
<appender-ref
ref=
"fileInfoLog"
/>
<appender-ref
ref=
"fileErrorLog"
/>
</root>
</springProfile>
</configuration>
</configuration>
\ No newline at end of file
src/main/resources/logback-spring.xml.back
0 → 100644
View file @
955353e3
<?xml version="1.0" encoding="UTF-8"?>
<configuration
scan=
"true"
scanPeriod=
"30 seconds"
debug=
"false"
>
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
<property
name=
"LOG_HOME"
value=
"./logs"
/>
<!-- 控制台输出 -->
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n
</pattern>
</encoder>
</appender>
<!-- 按照每天生成日志文件 -->
<appender
name=
"FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!--日志文件输出的文件名-->
<FileNamePattern>
${LOG_HOME}/EDUCATION.log.%d{yyyy-MM-dd}.log
</FileNamePattern>
<!--日志文件保留天数-->
<MaxHistory>
30
</MaxHistory>
<!--<MaxFileSize>2 KB</MaxFileSize>-->
</rollingPolicy>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n
</pattern>
</encoder>
</appender>
<!--myibatis log configure-->
<logger
name=
"com.apache.ibatis"
level=
"TRACE"
/>
<logger
name=
"java.sql.Connection"
level=
"DEBUG"
/>
<logger
name=
"java.sql.Statement"
level=
"DEBUG"
/>
<logger
name=
"java.sql.PreparedStatement"
level=
"DEBUG"
/>
<!-- 日志输出级别 -->
<root
level=
"DEBUG"
>
<appender-ref
ref=
"STDOUT"
/>
<appender-ref
ref=
"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