Recently when debugging code, need to see the current operation of the SQL executed, not found in the log, after modifying the Logback configuration succeeded, is now recorded as follows:
One, MyBatis version is 3.0.6 (I am using the version)
This version only needs to be modified Logback.xml
<logger name= "java.sql.Connection" level= "DEBUG"/>
<logger name= "java.sql.Statement" level= "DEBUG"/>
<logger name= "java.sql.PreparedStatement" level= "DEBUG"/>
Note: The level of the above configuration needs to be consistent or higher with the Logback log print (that is, root)
If you are printing SQL in the Eclipse console, you also need to make sure that you have a stdout configuration:
<root>
<level value= "DEBUG"/>
<appender-ref ref= "stdout"/>
......
</root>
Second, MyBatis version is 3.0.6, this version needs to be modified Logback.xml
<logger name= "DAO" level= "DEBUG"/>
MyBatis the SQL that is executed in the log log or console print