Skip to content

chore(bqjdbc): refactor log levels#13166

Open
Neenu1995 wants to merge 4 commits into
mainfrom
ns/refactor-logs
Open

chore(bqjdbc): refactor log levels#13166
Neenu1995 wants to merge 4 commits into
mainfrom
ns/refactor-logs

Conversation

@Neenu1995
Copy link
Copy Markdown
Contributor

@Neenu1995 Neenu1995 commented May 11, 2026

b/505825091

- Causal Exception Unwrapping: Updated async stream readers (BigQueryStatement) to check e.getCause(), properly categorizing wrapped network interrupts during query shutdown to prevent false severe error logs.
- POJO Log Stripping: Removed repetitive, low-level diagnostic logs from intermediate state wrappers (BigQueryCallableStatement) to improve per-connection file readability.
- Standardized Level Routing: All Non-ResultSet trace logs now logs at Level.FINER, cleanly separating infrastructure execution boundaries from raw data iteration outputs (Level.FINEST).

@Neenu1995 Neenu1995 requested review from a team as code owners May 11, 2026 20:21
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 refactors the logging infrastructure of the BigQuery JDBC driver to improve performance and consistency. It removes numerous manual method entry/exit logs across the codebase, replacing them with a centralized logging mechanism within BigQueryJdbcContextProxy using dynamic proxies. The BigQueryJdbcResultSetLogger and BigQueryJdbcRootLogger were updated to better handle LogRecord objects and thread IDs. Feedback highlights potential reliability risks in the proxy's logging logic where calling toString() on arguments or results could trigger exceptions, and notes that setting thread IDs manually in the thread factory is misleading and redundant.

@Neenu1995 Neenu1995 marked this pull request as draft May 11, 2026 20:32
@Neenu1995
Copy link
Copy Markdown
Contributor Author

/gemini review

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 refactors the logging infrastructure across the BigQuery JDBC driver, primarily shifting method entry/exit tracing from Level.FINEST to Level.FINER and introducing a more structured LogRecord approach to avoid expensive stack trace parsing. It also enhances the BigQueryJdbcContextProxy to automatically log method calls and results. Feedback focuses on a security concern regarding the potential for sensitive data exposure (CWE-532) when logging all method arguments and return values at the FINER level, as well as the performance implications of wrapping high-frequency JDBC operations.

@Neenu1995 Neenu1995 marked this pull request as ready for review May 12, 2026 19:29
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