arthas icon indicating copy to clipboard operation
arthas copied to clipboard

mybatis的ServiceImpl对应方法如何查看执行SQL?

Open a372342061 opened this issue 11 months ago • 1 comments

请问,我有一个Service继承了mybatis的ServiceImpl,在我通过 xxxservice.list(XX)方法执行时我如何才能查看到对应的执行的SQL?

a372342061 avatar Jan 09 '25 08:01 a372342061

If you use Spring Boot, you can enable SQL logging by adding it to the properties file.

logging.level.com.baomidou.mybatisplus=debug logging.level.org.apache.ibatis=debug

If you use Logback, configure logback.xml like this:

sheikmca avatar Feb 23 '25 13:02 sheikmca