WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Logging Statements

Mirro Mutth edited this page Feb 15, 2024 · 1 revision

Use the io.asyncer.r2dbc.mysql.QUERY logger and the DEBUG log level to log statements and their bound parameters (if it is prepared statement).

For example, in logback.xml:

<configuration>
    <!-- ... -->
    <logger name="io.asyncer.r2dbc.mysql" level="INFO"/> <!-- or DEBUG if necessary -->
    <logger name="io.asyncer.r2dbc.mysql.QUERY" level="DEBUG"/>
    <!-- ... -->
</configuration>

Note that it will print the SQL statement and all parameters, so this may be a security risk. Don't use it in an environment with sensitive data. It should be used for debugging purposes only.

The log format may be different for server preparation and client preparation. This is because the actual generated statements and commands are different in these two modes. For example, a server-preparing statement has its statement ID that's generated by server, but client-preparing does not.

Clone this wiki locally