From 0383012f225df5ffceabf9cc2b74a5bc7e4e815a Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Sat, 26 Jul 2025 11:29:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=BF=97=E9=95=BF=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jdbcUtil/service/SqlLogInterceptor.java | 12 +++++-- .../impl/SysApplicationServiceImpl.java | 33 ++++++++++++++----- 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/base-common/src/main/java/com/hzya/frame/jdbcUtil/service/SqlLogInterceptor.java b/base-common/src/main/java/com/hzya/frame/jdbcUtil/service/SqlLogInterceptor.java index 7eeaec07..be78399c 100644 --- a/base-common/src/main/java/com/hzya/frame/jdbcUtil/service/SqlLogInterceptor.java +++ b/base-common/src/main/java/com/hzya/frame/jdbcUtil/service/SqlLogInterceptor.java @@ -64,9 +64,17 @@ public class SqlLogInterceptor implements Interceptor { stringBuffer.append(paramList.get(i)); } } - log.info("completeSql:"+stringBuffer.toString()); + if ( stringBuffer.toString().length() <= 1000){ + log.info("completeSql:"+stringBuffer.toString()); + }else { + log.info("completeSql:"+stringBuffer.toString().substring(1000)); + } }else { - log.info("completeSql:"+sql); + if ( sql.length() <= 1000){ + log.info("completeSql:"+sql); + }else { + log.info("completeSql:"+sql.substring(1000)); + } } Object proceed = invocation.proceed(); int result = 0; diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java index 5afcadef..eaeef4ee 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java @@ -137,6 +137,7 @@ public class SysApplicationServiceImpl extends BaseService