-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Reverted log4j shading due to regressions caused. #46546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reverted log4j shading due to regressions caused. #46546
Conversation
There was a problem hiding this 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 |
/azp run java - cosmos - spark |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/azp run java - cosmos - spark |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run java - cosmos - spark |
Azure Pipelines successfully started running 1 pipeline(s). |
…to users/fabianm/log4jShadingRegressionFix
/azp run java - cosmos - spark |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run java - cosmos - spark |
Azure Pipelines successfully started running 1 pipeline(s). |
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:
General Guidelines and Best Practices
Testing Guidelines