• SpringBoot日志打印程序执行的SQL语句


    springboot默认使用logback来记录日志。

    属性:logging.level。见 spring-boot-*.RELEASE.jar里org.springframework.boot.context.logging.LoggingApplicationListener#LOGGING_LEVEL


    在application.yml里添加如下配置即可

    logging:
      level:
        com.emaxcard.boss.modules: debug
        com.emaxcard.boss.portal: debug

     或者在application.propertities里添加配置

    logging.level.com.emaxcard.boss.modules=debug
    logging.level.com.emaxcard.boss.portal=debug


    注意:
    1)mapper文件在指定的package下
    2)指定了package之后,这个package下所有的class文件的日志级别都是debug。即,这些class文件里的debug日志会打印到日志文件里。
    3)package路径注意书写正确。

    log示例:

    2021-12-17 18:10:07.009 [5ffff3f3f7ed43f294b7b4d3661c97fb] [OrderDetailServiceImpl_list1639735807008] DEBUG c.e.b.m.settlement.provider.OrderDetailServiceImpl:485 - [结算明细]-生成QueryWrapper请求参数={"encrypt":true,"taskId":1630922570528780}
    2021-12-17 18:10:07.014 [5ffff3f3f7ed43f294b7b4d3661c97fb] [OrderDetailServiceImpl_list1639735807008] DEBUG c.e.b.m.s.mapper.OrderDetailMapper.selectList:143 - ==>  Preparing: SELECT * FROM emax_order_detail WHERE task_id = ? ORDER BY create_time DESC 
    2021-12-17 18:10:07.015 [5ffff3f3f7ed43f294b7b4d3661c97fb] [OrderDetailServiceImpl_list1639735807008] DEBUG c.e.b.m.s.mapper.OrderDetailMapper.selectList:143 - ==> Parameters: 1630922570528780(Long)
    2021-12-17 18:10:07.049 [5ffff3f3f7ed43f294b7b4d3661c97fb] [OrderDetailServiceImpl_list1639735807008] DEBUG c.e.b.m.s.mapper.OrderDetailMapper.selectList:143 - <==      Total: 12
    2021-12-17 18:10:07.052 [5ffff3f3f7ed43f294b7b4d3661c97fb] [OrderDetailServiceImpl_list1639735807008] INFO  c.e.z.common.dubbothread.DubboThreadNameAspect:96 - 接口响应结果:{"code":200,"message":"成功","result":[{"bankAccountNo":"62148****1482783","userIdcardNo":"130682********0412","userName":"王力宏","userPhone":"1830153****","verifyStatus":"VERIFY_SUCCESS","workTyp...
    2021-12-17 18:10:07.053 [5ffff3f3f7ed43f294b7b4d3661c97fb] [OrderDetailServiceImpl_list1639735807008] INFO  c.e.z.common.dubbothread.DubboThreadNameAspect:147 - OrderDetailServiceImpl_list--duration=执行耗时=45ms

     

  • 相关阅读:
    安卓触摸事件探究
    android关于canvas,path,paint非常好的讲解
    android的Shader
    android中view的生命周期
    JAVA的Random类(转)
    lniux 64位导致adb无法运行解决方案
    [转]Android中attrs.xml文件的使用详解
    FlowLayout
    大数据平台架构技术选型与场景运用(转)
    mysql--java类型对应表
  • 原文地址:https://www.cnblogs.com/buguge/p/15705793.html
Copyright © 2020-2023  润新知