fix:日志调整优化

上级 2c849a9c
2023-07-15 12:46:06 [restartedMain] INFO c.k.s.SpringBootKwanApplication - Starting SpringBootKwanApplication using Java 1.8.0_321 on qinyingjiedeMacBook-Pro.local with PID 28497 (/Users/qinyingjie/Documents/idea-workspace/SpringBoot-kwan/target/classes started by qinyingjie in /Users/qinyingjie/Documents/idea-workspace/SpringBoot-kwan)
2023-07-15 12:46:06 [restartedMain] INFO c.k.s.SpringBootKwanApplication - No active profile set, falling back to 1 default profile: "default"
2023-07-15 12:46:06 [background-preinit] INFO o.h.validator.internal.util.Version - HV000001: Hibernate Validator 6.2.3.Final
2023-07-15 12:46:06 [restartedMain] INFO o.s.b.d.e.DevToolsPropertyDefaultsPostProcessor - Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2023-07-15 12:46:06 [restartedMain] INFO o.s.b.d.e.DevToolsPropertyDefaultsPostProcessor - For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2023-07-15 12:46:07 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Multiple Spring Data modules found, entering strict repository configuration mode!
2023-07-15 12:46:07 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Bootstrapping Spring Data Redis repositories in DEFAULT mode.
2023-07-15 12:46:07 [restartedMain] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 34 ms. Found 0 Redis repository interfaces.
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'io.seata.spring.boot.autoconfigure.SeataAutoConfiguration$SeataDataSourceConfiguration' of type [io.seata.spring.boot.autoconfigure.SeataAutoConfiguration$SeataDataSourceConfiguration$$EnhancerBySpringCGLIB$$6c31cc4d] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'spring.cloud.alibaba.seata-io.seata.spring.boot.autoconfigure.properties.SpringCloudAlibabaConfiguration' of type [io.seata.spring.boot.autoconfigure.properties.SpringCloudAlibabaConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'seata-io.seata.spring.boot.autoconfigure.properties.SeataProperties' of type [io.seata.spring.boot.autoconfigure.properties.SeataProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'io.seata.spring.boot.autoconfigure.SeataAutoConfiguration' of type [io.seata.spring.boot.autoconfigure.SeataAutoConfiguration$$EnhancerBySpringCGLIB$$7677ac82] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'springApplicationContextProvider' of type [io.seata.spring.boot.autoconfigure.provider.SpringApplicationContextProvider] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'failureHandler' of type [io.seata.tm.api.DefaultFailureHandlerImpl] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO i.s.s.b.a.SeataAutoConfiguration - Automatically configure Seata
2023-07-15 12:46:08 [restartedMain] INFO io.seata.config.FileConfiguration - The file name of the operation is registry
2023-07-15 12:46:08 [restartedMain] INFO io.seata.config.ConfigurationFactory - load Configuration:FileConfiguration$$EnhancerByCGLIB$$862af1eb
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'configProperties' of type [io.seata.spring.boot.autoconfigure.properties.config.ConfigProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'configFileProperties' of type [io.seata.spring.boot.autoconfigure.properties.config.ConfigFileProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO io.seata.config.FileConfiguration - The file name of the operation is file.conf
2023-07-15 12:46:08 [restartedMain] INFO io.seata.config.ConfigurationFactory - load Configuration:FileConfiguration$$EnhancerByCGLIB$$862af1eb
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'serviceProperties' of type [io.seata.spring.boot.autoconfigure.properties.client.ServiceProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO i.s.s.a.GlobalTransactionScanner - Initializing Global Transaction Clients ...
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'threadFactoryProperties' of type [io.seata.spring.boot.autoconfigure.properties.client.ThreadFactoryProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'transportProperties' of type [io.seata.spring.boot.autoconfigure.properties.client.TransportProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO i.s.c.rpc.netty.NettyClientBootstrap - NettyClientBootstrap has started
2023-07-15 12:46:08 [restartedMain] INFO i.s.s.a.GlobalTransactionScanner - Transaction Manager Client is initialized. applicationId[spring-boot-name] txServiceGroup[default_tx_group]
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'rmProperties' of type [io.seata.spring.boot.autoconfigure.properties.client.RmProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO io.seata.rm.datasource.AsyncWorker - Async Commit Buffer Limit: 10000
2023-07-15 12:46:08 [restartedMain] INFO i.s.r.d.xa.ResourceManagerXA - ResourceManagerXA init ...
2023-07-15 12:46:08 [restartedMain] INFO i.s.c.rpc.netty.NettyClientBootstrap - NettyClientBootstrap has started
2023-07-15 12:46:08 [restartedMain] INFO i.s.s.a.GlobalTransactionScanner - Resource Manager is initialized. applicationId[spring-boot-name] txServiceGroup[default_tx_group]
2023-07-15 12:46:08 [restartedMain] INFO i.s.s.a.GlobalTransactionScanner - Global Transaction Clients are initialized.
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'spring.datasource.dynamic-com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties' of type [com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration' of type [com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration$$EnhancerBySpringCGLIB$$164c1ef7] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:08 [restartedMain] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'dsProcessor' of type [com.baomidou.dynamic.datasource.processor.DsHeaderProcessor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-07-15 12:46:09 [restartedMain] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8888 (http)
2023-07-15 12:46:09 [restartedMain] INFO o.a.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-8888"]
2023-07-15 12:46:09 [restartedMain] INFO o.a.catalina.core.StandardService - Starting service [Tomcat]
2023-07-15 12:46:09 [restartedMain] INFO o.a.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.60]
2023-07-15 12:46:09 [restartedMain] INFO o.a.c.c.C.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
2023-07-15 12:46:09 [restartedMain] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 3067 ms
2023-07-15 12:46:10 [restartedMain] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource detect ALIBABA SEATA and enabled it
2023-07-15 12:46:10 [restartedMain] INFO c.alibaba.druid.pool.DruidDataSource - {dataSource-1,kwan-ds} inited
2023-07-15 12:46:10 [restartedMain] ERROR i.s.c.r.n.NettyClientChannelManager - can not get cluster name in registry config 'service.vgroupMapping.default_tx_group', please make sure registry config correct
2023-07-15 12:46:10 [restartedMain] INFO c.alibaba.druid.pool.DruidDataSource - {dataSource-2,ali-ds} inited
2023-07-15 12:46:10 [restartedMain] ERROR i.s.c.r.n.NettyClientChannelManager - can not get cluster name in registry config 'service.vgroupMapping.default_tx_group', please make sure registry config correct
2023-07-15 12:46:10 [restartedMain] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource - add a datasource named [kwan-ds] success
2023-07-15 12:46:10 [restartedMain] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource - add a datasource named [ali-ds] success
2023-07-15 12:46:10 [restartedMain] INFO c.b.d.d.DynamicRoutingDataSource - dynamic-datasource initial loaded [2] datasource,primary datasource named [kwan-ds]
2023-07-15 12:46:10 [restartedMain] INFO i.s.s.a.d.SeataAutoDataSourceProxyCreator - Auto proxy of [dataSource]
2023-07-15 12:46:10 [restartedMain] ERROR i.s.c.r.n.NettyClientChannelManager - can not get cluster name in registry config 'service.vgroupMapping.default_tx_group', please make sure registry config correct
2023-07-15 12:46:11 [restartedMain] INFO c.k.s.config.RedisConfig - ==================自定义的redisTemplate实例化了===================
2023-07-15 12:46:11 [restartedMain] INFO i.s.s.a.GlobalTransactionScanner - Bean[com.kwan.springbootkwan.service.impl.UserServiceImpl$$EnhancerBySpringCGLIB$$80a9d5be] with name [userServiceImpl] would use interceptor [io.seata.spring.annotation.GlobalTransactionalInterceptor]
2023-07-15 12:46:12 [restartedMain] INFO o.s.b.d.a.OptionalLiveReloadServer - LiveReload server is running on port 35729
2023-07-15 12:46:13 [restartedMain] INFO o.s.b.c.r.s.JobRepositoryFactoryBean - No database type set, using meta data indicating: MYSQL
2023-07-15 12:46:13 [restartedMain] INFO o.s.b.c.l.support.SimpleJobLauncher - No TaskExecutor has been set, defaulting to synchronous executor.
2023-07-15 12:46:14 [restartedMain] INFO o.a.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-8888"]
2023-07-15 12:46:14 [restartedMain] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat started on port(s): 8888 (http) with context path ''
2023-07-15 12:46:14 [restartedMain] INFO s.d.s.w.p.DocumentationPluginsBootstrapper - Context refreshed
2023-07-15 12:46:14 [restartedMain] INFO s.d.s.w.p.DocumentationPluginsBootstrapper - Found 1 custom documentation plugin(s)
2023-07-15 12:46:14 [restartedMain] INFO s.d.s.w.s.ApiListingReferenceScanner - Scanning for api listing references
2023-07-15 12:46:14 [restartedMain] INFO s.d.s.w.r.o.CachingOperationNameGenerator - Generating unique operation named: selectAllUsingGET_1
2023-07-15 12:46:14 [restartedMain] INFO s.d.s.w.r.o.CachingOperationNameGenerator - Generating unique operation named: selectOneUsingGET_1
2023-07-15 12:46:14 [restartedMain] INFO s.d.s.w.r.o.CachingOperationNameGenerator - Generating unique operation named: deleteUsingDELETE_1
2023-07-15 12:46:14 [restartedMain] INFO s.d.s.w.r.o.CachingOperationNameGenerator - Generating unique operation named: insertUsingPOST_1
2023-07-15 12:46:14 [restartedMain] INFO s.d.s.w.r.o.CachingOperationNameGenerator - Generating unique operation named: selectAllUsingGET_2
2023-07-15 12:46:14 [restartedMain] INFO s.d.s.w.r.o.CachingOperationNameGenerator - Generating unique operation named: selectOneUsingGET_2
2023-07-15 12:46:14 [restartedMain] INFO s.d.s.w.r.o.CachingOperationNameGenerator - Generating unique operation named: updateUsingPUT_1
2023-07-15 12:46:14 [restartedMain] INFO c.k.s.SpringBootKwanApplication - Started SpringBootKwanApplication in 8.976 seconds (JVM running for 11.581)
此差异已折叠。
此差异已折叠。
package com.kwan.springbootkwan.aop;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
......@@ -14,8 +15,8 @@ import org.springframework.stereotype.Component;
*/
@Component
@Aspect
@Slf4j
public class LogAspect {
@Pointcut(value = "execution(* com.kwan.springbootkwan.service.*.*(..))")
public void pcl() {
}
......@@ -23,25 +24,25 @@ public class LogAspect {
@Before(value = "pcl()")
public void before(JoinPoint point) {
String name = point.getSignature().getName();
System.out.println(name + "方法开始执行 ...");
log.info(name + "方法开始执行 ...");
}
@After(value = "pcl()")
public void after(JoinPoint point) {
String name = point.getSignature().getName();
System.out.println(name + "方法执行结束 ...");
log.info(name + "方法执行结束 ...");
}
@AfterReturning(value = "pcl()", returning = "result")
public void afterReturning(JoinPoint point, Object result) {
String name = point.getSignature().getName();
System.out.println(name + "方法返回值为:" + result);
log.info(name + "方法返回值为:" + result);
}
@AfterThrowing(value = "pcl()", throwing = "e")
public void afterThrowing(JoinPoint point, Exception e) {
String name = point.getSignature().getName();
System.out.println(name + "方法抛异常了,异常是:" + e.getMessage());
log.info(name + "方法抛异常了,异常是:" + e.getMessage());
}
@Around("pcl()")
......
#这个配置是原始配置,不带seata
server:
port: 8761
servlet:
encoding:
force: true
charset: UTF-8
enabled: true
swagger:
enable: true
#兼容swagger配置
spring:
#项目启动时创建数据表的 SQL 脚本,该脚本由 Spring Batch 提供
#spring.datasource.schema=classpath:/org/springframework/batch/core/schema-mysql.sql
# 在项目启动时执行建表 SQL
batch:
initialize-schema: always
# 禁止 Spring Batch 自动执行,在 SpringBoot 中,默认情况,当项目启动时就会执行配置好的批理操作,添加了该配置后则不会自动执行,而需要用户手动触发执行
job:
enabled: false
mail:
host: smtp.qq.com
# 发送者的邮箱账号
username: 327782001@qq.com
# 邮箱密码授权码
password: kypxnmwfniqrcbeh
properties:
mail:
smtp:
auth: true
starttls:
enable: true
required: true
redis:
database: 0 # Redis数据库索引(默认为0)
host: 120.79.36.53 #Redis服务器地址
port: 6379 # Redis服务器连接端口
password: # Redis服务器连接密码(默认为空)
jedis:
pool:
max-active: 200 # 连接池最大连接数(使用负值表示没有限制)
max-idle: 10 # 连接池中的最大空闲连接
min-idle: 0 # 连接池中的最小空闲连接
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
mvc:
pathmatch:
matching-strategy: ant_path_matcher
# mysql
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/kwan?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
username: root
password: 716288qwe
#mybatis-plus配置
mybatis-plus:
configuration:
map-underscore-to-camel-case: true
call-setters-on-nulls: true
auto-mapping-behavior: full
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
mapper-locations: classpath*:mapper/**/*Mapper.xml
global-config:
banner: false
# 逻辑删除配置
db-config:
id-type: AUTO
logic-delete-field: delFlag
logic-delete-value: 1
logic-not-delete-value: 0
table-underline: true
#logger配置
logging:
config: classpath:logback-spring.xml
\ No newline at end of file
#这个配置是单数据库seata
server:
port: 8761
servlet:
encoding:
force: true
charset: UTF-8
enabled: true
swagger:
enable: true
#兼容swagger配置
spring:
application:
name: spring-boot-name
#项目启动时创建数据表的 SQL 脚本,该脚本由 Spring Batch 提供
#spring.datasource.schema=classpath:/org/springframework/batch/core/schema-mysql.sql
# 在项目启动时执行建表 SQL
batch:
initialize-schema: always
# 禁止 Spring Batch 自动执行,在 SpringBoot 中,默认情况,当项目启动时就会执行配置好的批理操作,添加了该配置后则不会自动执行,而需要用户手动触发执行
job:
enabled: false
mail:
host: smtp.qq.com
# 发送者的邮箱账号
username: 327782001@qq.com
# 邮箱密码授权码
password: kypxnmwfniqrcbeh
properties:
mail:
smtp:
auth: true
starttls:
enable: true
required: true
redis:
database: 0 # Redis数据库索引(默认为0)
host: 120.79.36.53 #Redis服务器地址
port: 6379 # Redis服务器连接端口
password: # Redis服务器连接密码(默认为空)
jedis:
pool:
max-active: 200 # 连接池最大连接数(使用负值表示没有限制)
max-idle: 10 # 连接池中的最大空闲连接
min-idle: 0 # 连接池中的最小空闲连接
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
mvc:
pathmatch:
matching-strategy: ant_path_matcher
# mysql
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/kwan?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
username: root
password: 716288qwe
seata:
application-id: spring-boot-name
tx-service-group: my-tx-group
service:
vgroup-mapping:
my-tx-group: seata-server
grouplist:
seata-server: 127.0.0.1:8091
enabled: true
#mybatis-plus配置
mybatis-plus:
configuration:
map-underscore-to-camel-case: true
call-setters-on-nulls: true
auto-mapping-behavior: full
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
mapper-locations: classpath*:mapper/**/*Mapper.xml
global-config:
banner: false
# 逻辑删除配置
db-config:
id-type: AUTO
logic-delete-field: delFlag
logic-delete-value: 1
logic-not-delete-value: 0
table-underline: true
#logger配置
logging:
config: classpath:logback-spring.xml
\ No newline at end of file
#不同库不同表,带seata
server:
port: 8761
servlet:
encoding:
force: true
charset: UTF-8
enabled: true
swagger:
enable: true
#兼容swagger配置
spring:
application:
name: spring-boot-name
#项目启动时创建数据表的 SQL 脚本,该脚本由 Spring Batch 提供
#spring.datasource.schema=classpath:/org/springframework/batch/core/schema-mysql.sql
# 在项目启动时执行建表 SQL
batch:
initialize-schema: always
# 禁止 Spring Batch 自动执行,在 SpringBoot 中,默认情况,当项目启动时就会执行配置好的批理操作,添加了该配置后则不会自动执行,而需要用户手动触发执行
job:
enabled: false
mail:
host: smtp.qq.com
# 发送者的邮箱账号
......@@ -39,16 +17,13 @@ spring:
database: 0 # Redis数据库索引(默认为0)
host: 120.79.36.53 #Redis服务器地址
port: 6379 # Redis服务器连接端口
password: # Redis服务器连接密码(默认为空)
password: 123456 # Redis服务器连接密码(默认为空)
jedis:
pool:
max-active: 200 # 连接池最大连接数(使用负值表示没有限制)
max-idle: 10 # 连接池中的最大空闲连接
min-idle: 0 # 连接池中的最小空闲连接
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
mvc:
pathmatch:
matching-strategy: ant_path_matcher
# mysql
datasource:
dynamic:
......@@ -57,46 +32,13 @@ spring:
datasource:
kwan-ds:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/kwan?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
# url: jdbc:mysql://localhost:3306/kwan?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
url: jdbc:mysql://120.79.36.53:3306/kwan?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
username: root
password: 716288qwe
# password: 716288qwe
password: 15671628341Qwe.
ali-ds:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://120.79.36.53:3306/kwan?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
username: root
password: 15671628341Qwe.
\ No newline at end of file
seata:
application-id: spring-boot-name
tx-service-group: my-tx-group
service:
vgroup-mapping:
my-tx-group: seata-server
grouplist:
seata-server: 127.0.0.1:8091
enabled: true
#mybatis-plus配置
mybatis-plus:
configuration:
map-underscore-to-camel-case: true
call-setters-on-nulls: true
auto-mapping-behavior: full
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
mapper-locations: classpath*:mapper/**/*Mapper.xml
global-config:
banner: false
# 逻辑删除配置
db-config:
id-type: AUTO
logic-delete-field: delFlag
logic-delete-value: 1
logic-not-delete-value: 0
table-underline: true
#logger配置
logging:
config: classpath:logback-spring.xml
\ No newline at end of file
......@@ -6,11 +6,10 @@ server:
charset: UTF-8
enabled: true
swagger:
enable: true
#兼容swagger配置
spring:
profiles:
active: local
application:
name: spring-boot-name
#项目启动时创建数据表的 SQL 脚本,该脚本由 Spring Batch 提供
......@@ -21,54 +20,14 @@ spring:
# 禁止 Spring Batch 自动执行,在 SpringBoot 中,默认情况,当项目启动时就会执行配置好的批理操作,添加了该配置后则不会自动执行,而需要用户手动触发执行
job:
enabled: false
mail:
host: smtp.qq.com
# 发送者的邮箱账号
username: 327782001@qq.com
# 邮箱密码授权码
password: kypxnmwfniqrcbeh
properties:
mail:
smtp:
auth: true
starttls:
enable: true
required: true
redis:
database: 0 # Redis数据库索引(默认为0)
host: 120.79.36.53 #Redis服务器地址
port: 6379 # Redis服务器连接端口
password: 123456 # Redis服务器连接密码(默认为空)
jedis:
pool:
max-active: 200 # 连接池最大连接数(使用负值表示没有限制)
max-idle: 10 # 连接池中的最大空闲连接
min-idle: 0 # 连接池中的最小空闲连接
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
mvc:
pathmatch:
matching-strategy: ant_path_matcher
# mysql
datasource:
dynamic:
seata: true
primary: kwan-ds
datasource:
kwan-ds:
driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://localhost:3306/kwan?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
url: jdbc:mysql://120.79.36.53:3306/kwan?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
username: root
# password: 716288qwe
password: 15671628341Qwe.
ali-ds:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://120.79.36.53:3306/kwan?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
username: root
password: 15671628341Qwe.
seata:
tx-service-group: default_tx_group
#seata:
# tx-service-group: default_tx_group
swagger:
enable: true
#seata:
# application-id: spring-boot-name
......@@ -88,7 +47,7 @@ mybatis-plus:
map-underscore-to-camel-case: true
call-setters-on-nulls: true
auto-mapping-behavior: full
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl #关闭sql日志
mapper-locations: classpath*:mapper/**/*Mapper.xml
......
......@@ -13,28 +13,50 @@
</encoder>
</appender>
<appender name="ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>logs/SpringBoot-kwan.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>
logs/SpringBoot-kwan-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<maxFileSize>128MB</maxFileSize>
<maxHistory>30</maxHistory>
<totalSizeCap>20GB</totalSizeCap>
<springProfile name="dev,test,uat">
<property name="log.dir" value="./logs/"/>
<property name="file.log.pattern"
value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX} %-5level [%thread] %logger{36} - %msg%n"/>
<appender name="SYSTEM_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">            
<fileNamePattern>${log.dir}system/%d.log</fileNamePattern>  
</rollingPolicy>
<encoder>
<pattern>${file.log.pattern}</pattern>
<charset>${log.charset}</charset>
</encoder>
<append>true</append>
</appender>
<appender name="SQL_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">            
<fileNamePattern>${log.dir}/sql/%d.log</fileNamePattern>  
</rollingPolicy>
<encoder>
<pattern>${file.log.pattern}</pattern>
<charset>${log.charset}</charset>
</encoder>
<append>true</append>
</appender>
</springProfile>
<logger name="com.kwan.springbootkwan.mapper" level="info" additivity="false">
<springProfile name="local">
<logger name="com.kwan.springbootkwan.mapper" level="DEBUG" additivity="false">
<appender-ref ref="STDOUT"/>
</logger>
<root level="info">
<root level="INFO">
<appender-ref ref="STDOUT"/>
<appender-ref ref="ROLLING"/>
</root>
</springProfile>
<springProfile name="dev,test,uat">
<logger name="com.kwan.springbootkwan.mapper" level="DEBUG" additivity="false">
<appender-ref ref="SQL_LOG"/>
</logger>
<root level="INFO">
<appender-ref ref="SYSTEM_LOG"/>
</root>
</springProfile>
</configuration>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册