How to configure Log4J in Mybatis to print out SQL statements?

Updated on technology 2024-03-01
10 answers
  1. Anonymous users2024-02-06

    Use log4j to output in the console, configure the path in the properties file, and console

    #console

    If you don't want to print Spring's debug output, change the debug in the first line to info

  2. Anonymous users2024-02-05

    mybatis how to configure log4j to print out s", the user's detailed questions include: rt, I want to know: mybatis how to configure log4j to print out sql statements, the specific solutions are as follows:

    Solution 1: stdout

    That's how it's configured.

  3. Anonymous users2024-02-04

    The configuration is as follows:

    #'.'yyyy-mm-dd

    logs is the log output file location

    console, product

  4. Anonymous users2024-02-03

    1. Log4j configuration.

    2. Import the jar

    log4jlog4j

    slf4j-api

    slf4j-log4j12

    3. Note that the SLF4J package must be imported, otherwise the SQL statement will not be printed.

  5. Anonymous users2024-02-02

    Log4J's base copy basic configuration you should have that side, the following is the SQL output configuration Formatting the output SQL execution process.

  6. Anonymous users2024-02-01

    1. Log4j configuration.

    html] view plain copy2, import jar

    html] view plain copylog4j

    log4jslf4j-api

    slf4j-log4j12

    3. No, pay attention to the package of SLF4J must be imported, otherwise the SQL statement will not be printed.

  7. Anonymous users2024-01-31

    ybatis uses log4j by default, and it will not be able to print SQL when the self4j log jar package exists

    Debug is required

    stdout,file

    # %d, [9t], 5p], c.%m(%l), m%n%d, [9t], 5p], c.(%3l), m%n'.yyyy-mm-dd

    d, [9t], 5p], c.%m(%l), m%n# opensymphony stuff

    # spring stuff

    #mybatis console

    ########## new 20141225# opensymphony stuff

    # spring stuff

    #mybatis console

    The SQL statement section is displayed.

    stdout

  8. Anonymous users2024-01-30

    Log4j is configured to type the SQL logs into a separate log file.

  9. Anonymous users2024-01-29

    Mine is under the src directory as follows:

    logger

    Configure the root logger to define the root logger configuration item. The syntax is: level, input terminal 1, output terminal 2

    stdout

    Direct Log Messages to Stdout (standard terminal output).

    Console output (stdout stands for log output to console) custom output layout.

    The format of the output.

  10. Anonymous users2024-01-28

    Hello: Mine is in the src directory as follows: Configuration of the logger Configuring the root logger defines the root logger configuration item.

    The syntax is: level, input terminal 1, output terminal 2, stdout direct log messages to stdout

Related questions
30 answers2024-03-01

Look at your memory, it is DDR3 generation memory, and the hard disk is 500G, which is considered a mainstream configuration. So in terms of configuration, it's not too low.

12 answers2024-03-01

Dark Samurai 4 professional skills are available, and they can be grouped by themselves, for example: the skills of the blind man can be seen at a glance how to combo.

18 answers2024-03-01

2 choices one is not to change the motherboard CPU upgrade to Athlon 64x2 5400+ or above About**are all around 400 Buy a 2G DDR2 strip About 200 Finally, the graphics card buys GTX460 powerful graphics card Don't worry about the graphics card in the next 3 years If you want to use the brand, Yingla's or Zotac's But the power consumption of 460 is relatively high Full load is about 140W You need to calculate the power of the power supply **It's about 1200 to 1400. >>>More

27 answers2024-03-01

To put it simply, there are profiteers who can modify hardware information by modifying the registry. >>>More

23 answers2024-03-01

Memory plus 1G 667,The graphics card has to be replaced with a better one,I don't know the model,I don't know which one your motherboard supports at most。 The hard drive can be replaced with a 7200r with a capacity of 250g or larger. The high temperature may be a lot of dust, you can disassemble and clean it, you can also disassemble the CPU, graphics card fan, reapply silicone grease, poor hands-on ability can go to the computer store, it is estimated that it is not expensive.