MariaDB Connector/J のロギング設定

As Per Lundberg already stated, logging is possible since version 1.5.0, see here.

To activate it, I added &log=true to my database URL. However, this was not sufficient. As explained here, the following steps are also needed:

First, we need to add some dependencies:

Then we need to configure logback like in the given example:
<?xml version="1.0" encoding="UTF-8"?>

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
            <pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n</pattern>

    <logger name="org.mariadb.jdbc" level="trace" additivity="false">
        <appender-ref ref="STDOUT"/>

    <root level="error">
        <appender-ref ref="STDOUT"/>


The "trace" log level gives a lot of information, so you might want to use another one. The currently supported log levels are: trace, debug, info, warn or error

java - MariaDB JDBC Client Logging - Stack Overflow