日志打开
This commit is contained in:
parent
96c5fc8d09
commit
972cc64b7e
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.czg.config;
|
||||||
|
|
||||||
|
import com.mybatisflex.core.audit.AuditManager;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Administrator
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
@Slf4j(topic = "mybatis-flex-sql")
|
||||||
|
public class MybatisFlexConfig {
|
||||||
|
public MybatisFlexConfig() {
|
||||||
|
//开启审计功能
|
||||||
|
AuditManager.setAuditEnable(true);
|
||||||
|
|
||||||
|
//设置 SQL 审计收集器
|
||||||
|
AuditManager.setMessageCollector(auditMessage ->
|
||||||
|
log.info("{},{}ms", auditMessage.getFullSql()
|
||||||
|
, auditMessage.getElapsedTime())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue