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">
|
<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/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/license-LGPL%20v3-blue.svg" alt="Build Status">
|
||||||
<img src="https://img.shields.io/badge/Spring%20Cloud-2023-blue.svg" alt="Coverage 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.apache.ibatis.logging.nologging.NoLoggingImpl;
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springblade.core.mp.intercept.QueryInterceptor;
|
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.plugins.BladePaginationInterceptor;
|
||||||
import org.springblade.core.mp.props.MybatisPlusProperties;
|
import org.springblade.core.mp.props.MybatisPlusProperties;
|
||||||
import org.springblade.core.secure.utils.SecureUtil;
|
import org.springblade.core.secure.utils.SecureUtil;
|
||||||
@ -105,8 +105,8 @@ public class MybatisPlusConfiguration {
|
|||||||
*/
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
@ConditionalOnProperty(value = "blade.mybatis-plus.sql-log", matchIfMissing = true)
|
@ConditionalOnProperty(value = "blade.mybatis-plus.sql-log", matchIfMissing = true)
|
||||||
public SqlLogFilter sqlLogFilter(MybatisPlusProperties properties) {
|
public SqlLogInterceptor sqlLogInterceptor(MybatisPlusProperties properties) {
|
||||||
return new SqlLogFilter(properties);
|
return new SqlLogInterceptor(properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -117,10 +117,12 @@ public class MybatisPlusConfiguration {
|
|||||||
public MybatisPlusPropertiesCustomizer mybatisPlusPropertiesCustomizer() {
|
public MybatisPlusPropertiesCustomizer mybatisPlusPropertiesCustomizer() {
|
||||||
return properties -> {
|
return properties -> {
|
||||||
CoreConfiguration configuration = properties.getConfiguration();
|
CoreConfiguration configuration = properties.getConfiguration();
|
||||||
|
if (configuration != null) {
|
||||||
Class<? extends Log> logImpl = configuration.getLogImpl();
|
Class<? extends Log> logImpl = configuration.getLogImpl();
|
||||||
if (logImpl == null) {
|
if (logImpl == null) {
|
||||||
configuration.setLogImpl(NoLoggingImpl.class);
|
configuration.setLogImpl(NoLoggingImpl.class);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* 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.DbType;
|
||||||
import com.alibaba.druid.filter.FilterChain;
|
import com.alibaba.druid.filter.FilterChain;
|
||||||
@ -45,7 +45,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class SqlLogFilter extends FilterEventAdapter {
|
public class SqlLogInterceptor extends FilterEventAdapter {
|
||||||
private static final SQLUtils.FormatOption FORMAT_OPTION = new SQLUtils.FormatOption(false, false);
|
private static final SQLUtils.FormatOption FORMAT_OPTION = new SQLUtils.FormatOption(false, false);
|
||||||
private final MybatisPlusProperties properties;
|
private final MybatisPlusProperties properties;
|
||||||
|
|
2
pom.xml
2
pom.xml
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<!-- Blade-Tool Version -->
|
<!-- Blade-Tool Version -->
|
||||||
<revision>4.4.0</revision>
|
<revision>4.4.1</revision>
|
||||||
<module.name>org.springblade.blade.tool</module.name>
|
<module.name>org.springblade.blade.tool</module.name>
|
||||||
<!-- jdk Version -->
|
<!-- jdk Version -->
|
||||||
<java.version>17</java.version>
|
<java.version>17</java.version>
|
||||||
|
Loading…
Reference in New Issue
Block a user