From fc63643b3f24231eb82a9c2ad7d9eedf88da2b78 Mon Sep 17 00:00:00 2001 From: mianbin Date: Fri, 10 Jan 2025 15:20:17 +0800 Subject: [PATCH] =?UTF-8?q?1:=20=E8=B0=83=E6=95=B4=E4=BA=86=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E7=BA=A7=E5=88=AB=E5=92=8C=E6=97=A5=E5=BF=97=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=202=EF=BC=9A=E5=AF=B9cacheutils=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E7=A7=81=E6=9C=89=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/commons/util/cache/CacheUtils.java | 14 ++++++++++---- .../src/main/resources/application-dev.yaml | 4 ++++ .../src/main/resources/application-local.yaml | 16 +++++----------- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/framework/commons/src/main/java/cd/casic/framework/commons/util/cache/CacheUtils.java b/framework/commons/src/main/java/cd/casic/framework/commons/util/cache/CacheUtils.java index bdcb862..848bd47 100644 --- a/framework/commons/src/main/java/cd/casic/framework/commons/util/cache/CacheUtils.java +++ b/framework/commons/src/main/java/cd/casic/framework/commons/util/cache/CacheUtils.java @@ -14,17 +14,23 @@ import java.util.concurrent.Executors; */ public class CacheUtils { + /** + * 拒绝实例化 + */ + private CacheUtils() { + } + /** * 构建异步刷新的 LoadingCache 对象 - * + *

* 注意:如果你的缓存和 ThreadLocal 有关系,要么自己处理 ThreadLocal 的传递,要么使用 {@link #buildCache(Duration, CacheLoader)} 方法 - * + *

* 或者简单理解: * 1、和“人”相关的,使用 {@link #buildCache(Duration, CacheLoader)} 方法 * 2、和“全局”、“系统”相关的,使用当前缓存方法 * * @param duration 过期时间 - * @param loader CacheLoader 对象 + * @param loader CacheLoader 对象 * @return LoadingCache 对象 */ public static LoadingCache buildAsyncReloadingCache(Duration duration, CacheLoader loader) { @@ -39,7 +45,7 @@ public class CacheUtils { * 构建同步刷新的 LoadingCache 对象 * * @param duration 过期时间 - * @param loader CacheLoader 对象 + * @param loader CacheLoader 对象 * @return LoadingCache 对象 */ public static LoadingCache buildCache(Duration duration, CacheLoader loader) { diff --git a/ops-server/src/main/resources/application-dev.yaml b/ops-server/src/main/resources/application-dev.yaml index 5484f78..e240ff4 100644 --- a/ops-server/src/main/resources/application-dev.yaml +++ b/ops-server/src/main/resources/application-dev.yaml @@ -119,6 +119,10 @@ spring: # 日志文件配置 logging: + level: + root: error + pattern: + console: "%d{yyyy-MM-dd HH:mm:ss:sss} %-5level %logger{36} - %msg%n" file: name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径 diff --git a/ops-server/src/main/resources/application-local.yaml b/ops-server/src/main/resources/application-local.yaml index 533b76e..56be1ad 100644 --- a/ops-server/src/main/resources/application-local.yaml +++ b/ops-server/src/main/resources/application-local.yaml @@ -137,28 +137,22 @@ spring: # 日志文件配置 logging: + pattern: + console: "%d{yyyy-MM-dd HH:mm:ss:sss} %-5level %logger{36} - %msg%n" file: name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径 level: +# root: error # 配置自己写的 MyBatis Mapper 打印日志 - cd.casic.module.bpm.dal.mysql: debug - cd.casic.module.infra.dal.mysql: debug + cd.casic.module.infra.dal.mysql: info cd.casic.module.infra.dal.mysql.logger.ApiErrorLogMapper: INFO # 配置 ApiErrorLogMapper 的日志级别为 info,避免和 GlobalExceptionHandler 重复打印 cd.casic.module.infra.dal.mysql.job.JobLogMapper: INFO # 配置 JobLogMapper 的日志级别为 info cd.casic.module.infra.dal.mysql.file.FileConfigMapper: INFO # 配置 FileConfigMapper 的日志级别为 info - cd.casic.module.pay.dal.mysql: debug - cd.casic.module.pay.dal.mysql.notify.PayNotifyTaskMapper: INFO # 配置 PayNotifyTaskMapper 的日志级别为 info cd.casic.module.system.dal.mysql: debug cd.casic.module.system.dal.mysql.sms.SmsChannelMapper: INFO # 配置 SmsChannelMapper 的日志级别为 info cd.casic.module.tool.dal.mysql: debug - cd.casic.module.member.dal.mysql: debug - cd.casic.module.trade.dal.mysql: debug cd.casic.module.promotion.dal.mysql: debug cd.casic.module.statistics.dal.mysql: debug - cd.casic.module.crm.dal.mysql: debug - cd.casic.module.erp.dal.mysql: debug - cd.casic.module.iot.dal.mysql: debug - cd.casic.module.ai.dal.mysql: debug - org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # TODO 芋艿:先禁用,Spring Boot 3.X 存在部分错误的 WARN 提示 + org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # 禁用,Spring Boot 3.X 存在部分错误的 WARN 提示 debug: false