ClickHouse / clickhouse-java

ClickHouse Java Clients & JDBC Driver
https://clickhouse.com
Apache License 2.0
1.44k stars 530 forks source link

JDBC driver prints stack trace to stdout #1827

Open jjtt opened 1 week ago

jjtt commented 1 week ago

Describe the bug

On some exceptions the JDBC driver prints a whole stack trace to stdout here: https://github.com/ClickHouse/clickhouse-java/blob/main/clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseClient.java#L963

This can mess up structured logging output for an application that uses the ClickHouse JDBC driver.

Steps to reproduce

  1. Connect to a db from an application
  2. Revoke the db credentials
  3. See stack trace in application stdout

Expected behaviour

Should use some common logging framework where the application can control logging from libraries. For example: SLF4J or logback.

Or throw an exception and let the application worry about it.