Giter Site home page Giter Site logo

如何配置sql日志 about mybatis-plus HOT 6 CLOSED

baomidou avatar baomidou commented on May 6, 2024
如何配置sql日志

from mybatis-plus.

Comments (6)

hellokaton avatar hellokaton commented on May 6, 2024 1

我这样配置就成功了

log4j.logger.SELECT=debug

不知道为什么日志输出的是如下的, SELECT是什么意思

SELECT.1915324600 | ==>  Preparing: select IFNULL(a.cont_click,0) as `cont_click`,a.*,b.class_name,c.user_truename,d.name `type_title`, b.class_folder,b.cont_templet as class_cont_templet,b.class_templet as class_templet from l_cont as a left join l_class as b on a.class_id=b.class_id left join l_admin as c on a.edit_userid=c.id left join tzzs_type as d on a.typeId=d.id where 1=1 AND a.class_id='4' AND a.sign='3' AND a.cont_commen='1' order by edit_date desc limit 0,8 
[bbs] 2016-10-08 13:38:33,948 DEBUG [RMI TCP Connection(3)-127.0.0.1] SELECT.1915324600 | ==> Parameters: 

from mybatis-plus.

qmdx avatar qmdx commented on May 6, 2024

与原生 Mybatis 日志一样配置,例如:
<logger name="org.apache.ibatis" additivity="false"> <level value="DEBUG" /> <appender-ref ref="Console" /> </logger>

from mybatis-plus.

qmdx avatar qmdx commented on May 6, 2024

SELECT是什么意思!!

也许是说明是查询日志?!

from mybatis-plus.

RoJinnSennSei avatar RoJinnSennSei commented on May 6, 2024

第一次配日志.... log4j2.xml 里 单独 com.张三.mapper是你自己的mapper所在包,
如果是springboot 配置log4j2.xml 发现 如果root的level设置为debug 控制台信息出现太多, 但是设置为info又看不到请求后执行的sql.(root的level也会影响底下appender的level 能否打印或输出)

from mybatis-plus.

RoJinnSennSei avatar RoJinnSennSei commented on May 6, 2024

<logger name="com.张三.mapper" level="debug"> <!--<appender-ref ref="debug_appender" />--> </logger>

from mybatis-plus.

jounghu avatar jounghu commented on May 6, 2024

logback怎么配置啊

from mybatis-plus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.