zoukankan      html  css  js  c++  java
  • SpringBoot在控制台打印出执行的sql语句日志

    配置application.yml或application.properties

    1. 结合mybatis

    1 mybatis:
    2   type-aliases-package: com.example.pojo
    3   mapper-locations: classpath:mapper/*.xml
    4   configuration:
    5     log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

    2. 使用logging模块
    方式一:application.yml

    1 ## 设置debug可以打印Sql语句
    2 logging:
    3   level:
    4     com:
    5       company:
    6         cache: debug
    7   ## 或者这样写
    8       com.company.cache: debug

    方式二:application.properties

    1 logging.level.com.company.cache=debug
    每天多努力一点,你将会变得更好。
  • 相关阅读:
    if 语句
    变量命名
    python变量
    运算符
    注释
    PyCharm
    python版本,执行
    Tornado 【简述】
    Git 【管理篇】
    MySQL的介绍
  • 原文地址:https://www.cnblogs.com/lidar/p/14602212.html
Copyright © 2011-2022 走看看