Use of Mybatis Log Plugin in IDEA

        Mybatis Log Plugin is a plug-in for recording the execution of Mybatis SQL statements, which helps developers easily track and analyze the SQL statements executed by Mybatis, so that it is easier to find problems in the program and optimize the performance of SQL statements.

Mybatis Log Plugin can record information such as SQL statements executed by Mybatis, execution time, parameter values, and returned results in the form of logs, and supports custom log output formats and log levels. Developers can configure them according to the actual situation of the project to achieve Best logging effect.

In short, Mybatis Log Plugin is a very practical Mybatis plug-in, which can greatly improve the developer's work efficiency and program stability.

But Mybatis Log Plugin has started to charge, here is a brief introduction to the use of the alternative product Mybatis Log Plus.

1. Search Mybatis log plus in the idea application market and download it

Most of them can be found here, if not, you can go to the official website to download

Restart idea after installation, if the restart fails, restart the computer

2. After installation, start it in View>>Tool Window

 After clicking here, it will start, and an icon will be displayed below.


Add the following sentence to the configuration file:

# mybatis-plus相关配置
mybatis-plus:
  configuration:
    #开启sql日志
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl


3. Start the project

As long as the console has sql printing, our mybatis sql log will automatically assemble and print the SQL on the console, and can also search according to the sql_id defined in the mapper file

4. Write at the end

Another alternative product, Mybatis Log free, is also available. It has the same effect as Mybatis Log Plugin, but it is actually the Mybatis Log Plugin of the shell.

Guess you like

Origin blog.csdn.net/qq_20957669/article/details/131163718