Skip to content

Fix logging when an OFF connection initializes first - #1645

Open
cat23123 wants to merge 1 commit into
databricks:mainfrom
cat23123:SC-241918-logging-off-to-enabled
Open

Fix logging when an OFF connection initializes first#1645
cat23123 wants to merge 1 commit into
databricks:mainfrom
cat23123:SC-241918-logging-off-to-enabled

Conversation

@cat23123

@cat23123 cat23123 commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Description

Fix process-wide JUL initialization when the first connection uses LogLevel=OFF.

  • OFF suppresses the shared parent logger without creating a handler or permanently completing initialization.
  • The first logging-enabled connection installs the single shared handler.
  • Once enabled, later connections—including OFF connections—do not reconfigure the logger.
  • Failed handler creation remains retryable.

Testing

  • Created unit tests that verifies that OFF -> TRACE enables logging, TRACE -> OFF continues to log at TRACE level, concurrent initializations do not create duplicate handlers.
  • Packaged thin and uber jars: manually verified OFF -> TRACE creates one handler, while TRACE -> OFF retains the original handler and level.

Additional Notes to the Reviewer

This is the short-term fix and intentionally keeps handler creation inside JulLogger.initLogger().

Signed-off-by: Cathleen Yan <cathleen.yan@databricks.com>
@cat23123
cat23123 marked this pull request as ready for review August 18, 2026 23:58
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