I'd like to use log4jdbc-log4j2 to log JDBC calls. The documentation providers information how to use it with Log4j2 markers.
<logger name="log4jdbc.log4j2" level="info" additivity="false">
<MarkerFilter marker="LOG4JDBC_OTHER" onMatch="DENY" onMismatch="NEUTRAL"/>
<appender-ref ref="Console"/>
</logger>
Is there any way how to rewrite the above code to work with Logback?
UPDATE: I already tried to put a TurboFilter outside the logger directly inside the configuration element. It however doesn't change the log output.
<turboFilter class="ch.qos.logback.classic.turbo.MarkerFilter">
<Name>LOG4JDBC_LOGBACK_FILTER</Name>
<Marker>LOG4JDBC_OTHER</Marker>
<OnMatch>DENY</OnMatch>
</turboFilter>
This works for me in logback.xml. This doesn't use markers at all but does what I need i.e. filters only sql statements (with timing).
These 6 loggers are described in log4jdbc-log4j2 documentation.