Skip to content

fix(bqjdbc): enhance logging with caller inference and explicit exception tracking#12903

Merged
Neenu1995 merged 6 commits intomainfrom
ns/fix-log-message
Apr 23, 2026
Merged

fix(bqjdbc): enhance logging with caller inference and explicit exception tracking#12903
Neenu1995 merged 6 commits intomainfrom
ns/fix-log-message

Conversation

@Neenu1995
Copy link
Copy Markdown
Contributor

@Neenu1995 Neenu1995 commented Apr 23, 2026

b/505727302

  • BigQueryJdbcCustomLogger.java:
    • Implemented stack trace analysis to route exact execution locations via Logger.logp().
    • Introduced Throwable interception overloads for SEVERE and WARNING tiers to print full stack traces when exceptions are thrown.
  • Catch Block Instrumentation: Added explicit Logs configurations to log exceptions:
    • BigQueryConnection.java
    • BigQueryBaseArray.java
    • BigQueryBaseStruct.java
    • BigQueryParameterHandler.java
    • BigQueryDaemonPollingTask.java
    • BigQueryJdbcProxyUtility.java
  • BigQueryJdbcCustomLoggerTest.java: Tests for changes made.

Note: More catch block instrumentation to follow in future PRs.

@Neenu1995 Neenu1995 requested review from a team as code owners April 23, 2026 17:02
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request improves error visibility across the BigQuery JDBC driver by introducing explicit logging in several catch blocks and enhancing the BigQueryJdbcCustomLogger to support caller inference and exception stack trace formatting. A new test class was also added to verify the logger's functionality. Review feedback suggests correcting a typo in the .gitignore file, optimizing the logger's caller inference, and refactoring the exception logging to use LogRecord for better integration with structured logging systems.

Comment thread java-bigquery/google-cloud-bigquery-jdbc/.gitignore Outdated
@Neenu1995 Neenu1995 merged commit ce4969b into main Apr 23, 2026
127 of 128 checks passed
@Neenu1995 Neenu1995 deleted the ns/fix-log-message branch April 23, 2026 20:18
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.

2 participants