🎉 4.4.1.RELEASE 修复mybatis-plus自定义日志逻辑

This commit is contained in:
smallchill 2025-01-09 10:43:41 +08:00
parent 2a22da946c
commit 9438770c5d
4 changed files with 12 additions and 10 deletions

View File

@ -1,5 +1,5 @@
<p align="center">
<img src="https://img.shields.io/badge/Release-V4.4.0-green.svg" alt="Downloads">
<img src="https://img.shields.io/badge/Release-V4.4.1-green.svg" alt="Downloads">
<img src="https://img.shields.io/badge/JDK-17+-green.svg" alt="Build Status">
<img src="https://img.shields.io/badge/license-LGPL%20v3-blue.svg" alt="Build Status">
<img src="https://img.shields.io/badge/Spring%20Cloud-2023-blue.svg" alt="Coverage Status">

View File

@ -27,7 +27,7 @@ import org.apache.ibatis.logging.Log;
import org.apache.ibatis.logging.nologging.NoLoggingImpl;
import org.mybatis.spring.annotation.MapperScan;
import org.springblade.core.mp.intercept.QueryInterceptor;
import org.springblade.core.mp.logger.SqlLogFilter;
import org.springblade.core.mp.plugins.SqlLogInterceptor;
import org.springblade.core.mp.plugins.BladePaginationInterceptor;
import org.springblade.core.mp.props.MybatisPlusProperties;
import org.springblade.core.secure.utils.SecureUtil;
@ -105,8 +105,8 @@ public class MybatisPlusConfiguration {
*/
@Bean
@ConditionalOnProperty(value = "blade.mybatis-plus.sql-log", matchIfMissing = true)
public SqlLogFilter sqlLogFilter(MybatisPlusProperties properties) {
return new SqlLogFilter(properties);
public SqlLogInterceptor sqlLogInterceptor(MybatisPlusProperties properties) {
return new SqlLogInterceptor(properties);
}
/**
@ -117,9 +117,11 @@ public class MybatisPlusConfiguration {
public MybatisPlusPropertiesCustomizer mybatisPlusPropertiesCustomizer() {
return properties -> {
CoreConfiguration configuration = properties.getConfiguration();
Class<? extends Log> logImpl = configuration.getLogImpl();
if (logImpl == null) {
configuration.setLogImpl(NoLoggingImpl.class);
if (configuration != null) {
Class<? extends Log> logImpl = configuration.getLogImpl();
if (logImpl == null) {
configuration.setLogImpl(NoLoggingImpl.class);
}
}
};
}

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springblade.core.mp.logger;
package org.springblade.core.mp.plugins;
import com.alibaba.druid.DbType;
import com.alibaba.druid.filter.FilterChain;
@ -45,7 +45,7 @@ import java.util.List;
*/
@Slf4j
@RequiredArgsConstructor
public class SqlLogFilter extends FilterEventAdapter {
public class SqlLogInterceptor extends FilterEventAdapter {
private static final SQLUtils.FormatOption FORMAT_OPTION = new SQLUtils.FormatOption(false, false);
private final MybatisPlusProperties properties;

View File

@ -36,7 +36,7 @@
<properties>
<!-- Blade-Tool Version -->
<revision>4.4.0</revision>
<revision>4.4.1</revision>
<module.name>org.springblade.blade.tool</module.name>
<!-- jdk Version -->
<java.version>17</java.version>