暂存提交
This commit is contained in:
@@ -11,3 +11,16 @@ powershell -ExecutionPolicy Bypass -File D:\baiyue-firstleg\scripts\publish-loca
|
|||||||
```
|
```
|
||||||
|
|
||||||
配置发布成功后,各服务仍由自身的 Nacos Discovery 配置在启动时自动注册,不需要手工创建服务实例。
|
配置发布成功后,各服务仍由自身的 Nacos Discovery 配置在启动时自动注册,不需要手工创建服务实例。
|
||||||
|
|
||||||
|
## MyBatis SQL 日志
|
||||||
|
|
||||||
|
本地公共配置使用 MyBatis `Slf4jImpl`,数据库服务的 Mapper 日志级别默认为 `DEBUG`。执行数据库操作时,控制台会打印 SQL 模板、参数和影响行数。
|
||||||
|
|
||||||
|
可通过环境变量统一调整:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
$env:MYBATIS_SQL_LOG_LEVEL = "INFO" # 关闭 SQL 明细
|
||||||
|
$env:MYBATIS_SQL_LOG_LEVEL = "DEBUG" # 打开 SQL 明细
|
||||||
|
```
|
||||||
|
|
||||||
|
修改后重新发布本地 Nacos 配置并重启相关服务。SQL 参数可能包含业务数据,该设置只用于本地开发,不得复制到测试或生产环境。
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ mybatis-plus:
|
|||||||
configuration:
|
configuration:
|
||||||
map-underscore-to-camel-case: true
|
map-underscore-to-camel-case: true
|
||||||
call-setters-on-nulls: true
|
call-setters-on-nulls: true
|
||||||
|
log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
|
||||||
global-config:
|
global-config:
|
||||||
banner: false
|
banner: false
|
||||||
db-config:
|
db-config:
|
||||||
@@ -49,6 +50,17 @@ mybatis-plus:
|
|||||||
logic-delete-field: deleted
|
logic-delete-field: deleted
|
||||||
logic-delete-value: 1
|
logic-delete-value: 1
|
||||||
logic-not-delete-value: 0
|
logic-not-delete-value: 0
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
com.baiyue.auth.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
|
||||||
|
com.baiyue.iam.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
|
||||||
|
com.baiyue.order.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
|
||||||
|
com.baiyue.firstleg.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
|
||||||
|
com.baiyue.warehouse.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
|
||||||
|
com.baiyue.file.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
|
||||||
|
com.baiyue.print.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
|
||||||
|
com.baiyue.audit.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
|
||||||
|
com.baiyue.eventbridge.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
|
||||||
springdoc:
|
springdoc:
|
||||||
api-docs.enabled: ${SWAGGER_ENABLED:true}
|
api-docs.enabled: ${SWAGGER_ENABLED:true}
|
||||||
swagger-ui.enabled: ${SWAGGER_ENABLED:true}
|
swagger-ui.enabled: ${SWAGGER_ENABLED:true}
|
||||||
|
|||||||
@@ -22,3 +22,14 @@ cd D:\baiyue-firstleg
|
|||||||
```
|
```
|
||||||
|
|
||||||
头程业务端口保持项目现有默认值,文件上传目录改为 `D:\baiyue-firstleg-runtime\uploads`。
|
头程业务端口保持项目现有默认值,文件上传目录改为 `D:\baiyue-firstleg-runtime\uploads`。
|
||||||
|
|
||||||
|
## MyBatis SQL 日志
|
||||||
|
|
||||||
|
本地 Nacos 公共配置默认开启 Mapper 的 `DEBUG` 日志,控制台可查看 SQL 模板、绑定参数和影响行数。修改开关后需重新发布配置并重启相关服务:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
$env:MYBATIS_SQL_LOG_LEVEL = "DEBUG"
|
||||||
|
powershell -ExecutionPolicy Bypass -File D:\baiyue-firstleg\scripts\publish-local-nacos-config.ps1
|
||||||
|
```
|
||||||
|
|
||||||
|
不需要打印 SQL 时,将 `MYBATIS_SQL_LOG_LEVEL` 设置为 `INFO`。该日志可能包含业务参数,仅限本地排障使用。
|
||||||
|
|||||||
Reference in New Issue
Block a user