Skip to content

Keep JDBC driver diagnostics out of stderr - #15

Merged
openai0229 merged 1 commit into
mainfrom
fix/jdbc-quiet-logs
Sep 20, 2026
Merged

openai0229 merged 1 commit into
mainfrom
fix/jdbc-quiet-logs

Conversation

@openai0229

Copy link
Copy Markdown
Contributor

What

A failed Oracle connection wrote 55 lines to stderr, 32 of them 信息: records and stack frames from the driver's own java.util.logging diagnostics, which buries the one actionable line.

JdbcWorker.main now resets the logging configuration before any driver loads, so vendor diagnostics stay silent; SQLX_JDBC_DEBUG=1 restores them for troubleshooting. The README notes the switch.

Verification

Same Oracle datasource with the default verify-full, worker built from this branch and passed through --worker-dir:

before: 55 stderr lines (32 of them driver logs / stack frames)
after:   0 stderr lines
after, with SQLX_JDBC_DEBUG=1: 55 stderr lines
  • Oracle with --tls disable: {"event":"connected"} and SELECT 1 AS one FROM dual returns [['1']], 0 extra stderr lines.
  • SQL Server default-TLS failure: message unchanged, 0 extra stderr lines.
  • mvn -B -f java/jdbc/pom.xml verify passed (2 tests).

Risks and limits

  • Driver diagnostics are hidden by default, so a support request needs SQLX_JDBC_DEBUG=1 to reproduce them.
  • LogManager.reset() also drops logging configuration a driver may install later; the drivers used here re-create what they need.

@openai0229
openai0229 merged commit d18f823 into main Sep 20, 2026
9 checks passed
@openai0229
openai0229 deleted the fix/jdbc-quiet-logs branch September 20, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant