4

mybatis-plus 有什么办法可以不展示很长的 sql 日志输出吗

 7 months ago
source link: https://www.v2ex.com/t/1013841
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  Java

mybatis-plus 有什么办法可以不展示很长的 sql 日志输出吗

  Biluesgakki · 2 小时 53 分钟前 · 293 次点击

大数据导入,批量插入数据的时候 sql 日志会影响导入性能,想把指定 sql 操作的 sql 语句屏蔽了 或者超过长度的 sql 语句屏蔽了,该如何操作?

edit:

另外 EasyExcel 导入 10w 条 100 个字段的 excel 读取时间大概在 35-40s 这个时间正常吗 有什么优化读取速度吗 已经分批读取了

6 条回复    2024-02-03 13:53:00 +08:00
justFxxk2060

justFxxk2060      2 小时 5 分钟前

这种不常见的需求,这种时间范围应该可以接受吧?
--Excel 导入 10w 条 读取时间大概在 35-40s
seedhk

seedhk      59 分钟前

SQL 默认的日志级别是 DEBUG 吧,如果没改过的话。将日志级别调到 info ,就看不到 SQL 了;
chendy

chendy      55 分钟前

1. 打印 sql 印象里是 mybatis 的功能,太长就关了日志就行
2. 正常也不正常,另外除非是频繁导数据,否则这个速度也没啥问题吧
yor1g

yor1g      52 分钟前

你们生产环境也打 sql 日志?
zhangyl

zhangyl      48 分钟前

mybatis-plus:
configuration:
# 关闭日志
log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
changdy

changdy      42 分钟前

可以通过调整指定方法等级的方式实现 ,比如:

<Logger name="com.*.**************.SyDictItemMapper.getDictList" level="warn"/>

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK