mart1nN
V2EX  ›  问与答

springboot mybatis 打印 Sql 到控制台

  •  
  •   mart1nN · Nov 15, 2019 · 3769 views
    This topic created in 2393 days ago, the information mentioned may be changed or developed.
    configuration:
        log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
    

    请教师父们 想要 @Test 测试时也输出 sql 还要其他的配置吗

    2 replies    2019-11-15 21:11:53 +08:00
    Artemisr
        1
    Artemisr  
       Nov 15, 2019
    logback 的配置这样写
    logging:
    level:
    cn.demo.business: info

    cn.demo.business 代表你 mapper 层的包名,需要看日志就把 info 改成 debug
    m1ch3ng
        2
    m1ch3ng  
       Nov 15, 2019
    可以用 mybatis log plugin 插件
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   964 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 21:58 · PVG 05:58 · LAX 14:58 · JFK 17:58
    ♥ Do have faith in what you're doing.