3

I am trying to view sql statements that go through my application's SQL Server JDBC connector. We are using mssql-jdbc. The app uses slf4j as the logging facade and the current implementation is Logback.

According to their documentation the JDBC driver uses Java Util logging. As such I have added the bridge for SLF4J to my pom.xml file as follows:

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jul-to-slf4j</artifactId>
    </dependency>

I have also added an appender using the Microsoft documentation that looks like this:

    <logger name="com.microsoft.sqlserver.jdbc.Statement" level="FINER" additivity="false">
      <appender-ref ref="CONSOLE"/>
    </logger>

However, no logging statements are ever seen. I have tried many different ways to configure the appender. Any help is appreciated.

NOTE: These SO questions answer the generic question of redirecting a java.util logging app to logback, but it is not working for this JDBC driver:

Mark Rotteveel
  • 90,369
  • 161
  • 124
  • 175
HDave
  • 20,975
  • 28
  • 135
  • 220

0 Answers0