diff --git a/pom.xml b/pom.xml index 02ad5b0..c0c6685 100644 --- a/pom.xml +++ b/pom.xml @@ -33,9 +33,9 @@ 2.5.1 - com.github.gavlyukovskiy - p6spy-spring-boot-starter - 1.7.1 + p6spy + p6spy + 3.8.2 org.apache.commons diff --git a/src/main/resources/spy.properties b/src/main/resources/spy.properties new file mode 100644 index 0000000..1a0d1db --- /dev/null +++ b/src/main/resources/spy.properties @@ -0,0 +1,32 @@ +#指定要加载的模块列表 +modulelist=com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory,com.p6spy.engine.outage.P6OutageFactory +#日志消息格式的实现类 +logMessageFormat=com.baomidou.mybatisplus.extension.p6spy.P6SpyLogger +#指定日志输出 到控制台 +#appender=com.baomidou.mybatisplus.extension.p6spy.StdoutLogger +#指定日志输出到 SLF4J 日志框架 +#appender=com.p6spy.engine.spy.appender.Slf4JLogger +#指定日志输出到 file文件 +appender=com.p6spy.engine.spy.appender.FileLogger +#定义日志文件的名称。 +logfile=sql.log +#是否注销 JDBC 驱动程序(默认不注销) +#deregisterdrivers=true +#设置是否在日志消息前添加前缀 +useprefix=true +#指定要排除的日志类别,不记录这些类别的日志 +excludecategories=info,debug,result,commit,resultset +#设置日志条目的日期时间格式 +dateformat=yyyy-MM-dd HH:mm:ss +#定义数据库方言的时间戳格式。 +databaseDialectTimestampFormat=yyyy-MM-dd HH:mm:ss +#指定 JDBC 驱动程序列表 +#driverlist=org.h2.Driver +#启用故障检测 +outagedetection=true +#设置故障检测的时间间隔(单位:分钟) +outagedetectioninterval=2 +#启用 SQL 过滤功能 +filter=true +#排除记录包含 "SELECT 1" 的 SQL 查询 +exclude=SELECT 1