diff --git a/web-api/src/main/resources/config/application-prod.yml b/web-api/src/main/resources/config/application-prod.yml new file mode 100644 index 00000000..7059369a --- /dev/null +++ b/web-api/src/main/resources/config/application-prod.yml @@ -0,0 +1,35 @@ + +# 使用环境配置,只需 JVM 参数里加:-Dspring.profiles.active=prod + +#======================================# +#========== Server settings ===========# +#======================================# + +server: + + port: 8980 + servlet: + context-path: /js + +#======================================# +#========== Database sttings ==========# +#======================================# + +# 数据库连接 +jdbc: + + # Mysql 数据库配置 + type: mysql + driver: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://127.0.0.1:3306/jeesite_v5?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai + username: root + password: 123456 + testSql: SELECT 1 + +#======================================# +#========== Spring settings ===========# +#======================================# + +# 日志配置 +logging: + config: classpath:config/logback-spring-prod.xml \ No newline at end of file diff --git a/web-api/src/main/resources/config/logback-spring-prod.xml b/web-api/src/main/resources/config/logback-spring-prod.xml new file mode 100644 index 00000000..66c6425f --- /dev/null +++ b/web-api/src/main/resources/config/logback-spring-prod.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + %d{MM-dd HH:mm:ss.SSS} %clr(%-5p) %clr([%-39logger{39}]){cyan} - %m%n%wEx + + + + + + ${log.path}/debug.log + + ${log.path}/debug.%d{yyyy-MM-dd}.%i.log.zip + 50MB + 30 + + + %d{yyyy-MM-dd HH:mm:ss.SSS} %-5p ${PID:- } [%15.15t] [%-39logger{39}] [%X{TRACE_ID}] - %m%n%wEx + + + + + + + ${log.path}/error.log + + ${log.path}/error.%d{yyyy-MM-dd}.%i.log.zip + 50MB + 30 + + + %d{yyyy-MM-dd HH:mm:ss.SSS} %-5p ${PID:- } [%15.15t] [%-39logger{39}] [%X{TRACE_ID}] - %m%n%wEx + + + ERROR + + + + + + + + + + + \ No newline at end of file diff --git a/web-api/src/main/resources/config/logback-spring.xml b/web-api/src/main/resources/config/logback-spring.xml index a21a9b62..81b9dfde 100644 --- a/web-api/src/main/resources/config/logback-spring.xml +++ b/web-api/src/main/resources/config/logback-spring.xml @@ -9,7 +9,7 @@ - + diff --git a/web/src/main/resources/config/application-prod.yml b/web/src/main/resources/config/application-prod.yml new file mode 100644 index 00000000..7059369a --- /dev/null +++ b/web/src/main/resources/config/application-prod.yml @@ -0,0 +1,35 @@ + +# 使用环境配置,只需 JVM 参数里加:-Dspring.profiles.active=prod + +#======================================# +#========== Server settings ===========# +#======================================# + +server: + + port: 8980 + servlet: + context-path: /js + +#======================================# +#========== Database sttings ==========# +#======================================# + +# 数据库连接 +jdbc: + + # Mysql 数据库配置 + type: mysql + driver: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://127.0.0.1:3306/jeesite_v5?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai + username: root + password: 123456 + testSql: SELECT 1 + +#======================================# +#========== Spring settings ===========# +#======================================# + +# 日志配置 +logging: + config: classpath:config/logback-spring-prod.xml \ No newline at end of file diff --git a/web/src/main/resources/config/logback-spring-prod.xml b/web/src/main/resources/config/logback-spring-prod.xml new file mode 100644 index 00000000..66c6425f --- /dev/null +++ b/web/src/main/resources/config/logback-spring-prod.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + %d{MM-dd HH:mm:ss.SSS} %clr(%-5p) %clr([%-39logger{39}]){cyan} - %m%n%wEx + + + + + + ${log.path}/debug.log + + ${log.path}/debug.%d{yyyy-MM-dd}.%i.log.zip + 50MB + 30 + + + %d{yyyy-MM-dd HH:mm:ss.SSS} %-5p ${PID:- } [%15.15t] [%-39logger{39}] [%X{TRACE_ID}] - %m%n%wEx + + + + + + + ${log.path}/error.log + + ${log.path}/error.%d{yyyy-MM-dd}.%i.log.zip + 50MB + 30 + + + %d{yyyy-MM-dd HH:mm:ss.SSS} %-5p ${PID:- } [%15.15t] [%-39logger{39}] [%X{TRACE_ID}] - %m%n%wEx + + + ERROR + + + + + + + + + + + \ No newline at end of file diff --git a/web/src/main/resources/config/logback-spring.xml b/web/src/main/resources/config/logback-spring.xml index a21a9b62..81b9dfde 100644 --- a/web/src/main/resources/config/logback-spring.xml +++ b/web/src/main/resources/config/logback-spring.xml @@ -9,7 +9,7 @@ - +