confluentinc / kafka-connect-jdbc

Kafka Connect connector for JDBC-compatible databases
Other
24 stars 958 forks source link

Hide logging in JdbcDriverInfo.java file #1444

Open arkudryavtsev opened 2 weeks ago

arkudryavtsev commented 2 weeks ago

Good day. because of logging info in the file JdbcDriverInfo.java there are many logs. and also the output of information is not done correctly. if (jdbcMajorVersion == jdbcMajorVersion() && jdbcMinorVersion() >= jdbcMinorVersion) { log.info("JDBC driver version {} is newer than required version {}.{}", this.jdbcMinorVersion(), jdbcMajorVersion, jdbcMinorVersion);

it is necessary to output not only this.jdbcMinorVersion() but also this.jdbcMajorVersion() for understandable and readable information. and also it is better to hide the log at level DEBUG

boris-faniuk-n26 commented 3 days ago

To add some context here. This log is being printed within interval defined by poll.interval.ms:

[2024-11-28 18:53:51,651] INFO Database connection established. (io.confluent.connect.jdbc.util.CachedConnectionProvider)
2024-11-28T18:53:51.656532744Z [2024-11-28 18:53:51,655] INFO JDBC driver version 2 is newer than required version 4.0 (io.confluent.connect.jdbc.util.JdbcDriverInfo)
2024-11-28T18:53:51.656612868Z [2024-11-28 18:53:51,655] INFO JDBC driver version 2 is newer than required version 4.0 (io.confluent.connect.jdbc.util.JdbcDriverInfo)
2024-11-28T18:53:51.656622867Z [2024-11-28 18:53:51,655] INFO JDBC driver version 2 is newer than required version 4.0 (io.confluent.connect.jdbc.util.JdbcDriverInfo)
2024-11-28T18:53:51.656631909Z [2024-11-28 18:53:51,655] INFO JDBC driver version 2 is newer than required version 4.0 (io.confluent.connect.jdbc.util.JdbcDriverInfo)
2024-11-28T18:53:51.656640076Z [2024-11-28 18:53:51,656] INFO JDBC driver version 2 is newer than required version 4.0 (io.confluent.connect.jdbc.util.JdbcDriverInfo)
2024-11-28T18:53:51.656647700Z 

As you can this is being printed 5 times on every poll. Also, the message itself is confusing - why 2 is newer than 4.0 ? I could only understand after looking at this code. If minor version differs, log message should be different.