Skip to content

Conversation

FabianMeiswinkel
Copy link
Member

@FabianMeiswinkel FabianMeiswinkel commented Aug 29, 2025

Description

Reverting the change to shade log4j. Log4j documentation clealry calls out that either wihtin an application log4j should be shaded everywhere - or nowhere. Mixing shaded and unshaded log4j depdnencies can cause issues due to loading several dependencies via reflection etc. Since within the Spark connector we don't own the application - we can only follow what Spark is doing and not shade log4j and live with/workaorund any possible versioning conflicts.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@Copilot Copilot AI review requested due to automatic review settings August 29, 2025 08:52
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR reverts the log4j shading changes that were introduced in version 4.38.1 due to regressions they caused. The change removes log4j from the shaded packages and adds a safety check to ensure Azure Monitor logging is only configured when explicitly enabled.

Key Changes:

  • Reverted log4j-core and log4j-slf4j-impl shading configuration from the Maven POM
  • Added an additional condition to check azMonConfig.enabled before configuring Azure Monitor logging
  • Updated changelog to document the regression and reversion

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
sdk/cosmos/azure-cosmos-spark_3_2-12/pom.xml Removed log4j shading configuration that caused regressions
sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/CosmosClientCache.scala Added enabled check before configuring Azure Monitor logging
sdk/cosmos/azure-cosmos-spark_3-5_2-12/CHANGELOG.md Updated changelog to document the regression and its fix

@FabianMeiswinkel
Copy link
Member Author

/azp run java - cosmos - spark

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Azure Azure deleted a comment from azure-pipelines bot Aug 29, 2025
Copy link
Member

@tvaron3 tvaron3 left a comment

Choose a reason for hiding this comment

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

LGTM

@FabianMeiswinkel
Copy link
Member Author

/azp run java - cosmos - spark

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@FabianMeiswinkel
Copy link
Member Author

/azp run java - cosmos - spark

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@FabianMeiswinkel
Copy link
Member Author

/azp run java - cosmos - spark

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@FabianMeiswinkel
Copy link
Member Author

/azp run java - cosmos - spark

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@FabianMeiswinkel FabianMeiswinkel merged commit bab71bc into Azure:main Sep 3, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants