mirror of
https://github.com/chillzhuang/blade-tool
synced 2025-01-10 15:05:28 +08:00
🎉 4.4.1.RELEASE 修复mybatis-plus自定义日志逻辑
This commit is contained in:
parent
2a22da946c
commit
9438770c5d
@ -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">
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user