Fix azure-core native image logging initialization#49855
Open
arnabnandy7 wants to merge 2 commits into
Open
Conversation
arnabnandy7
requested review from
a team,
JonathanGiles,
alzimmermsft,
samvaity,
srnagar and
vcolin7
as code owners
July 17, 2026 08:19
|
Azure Pipelines: Successfully started running 1 pipeline(s). 34 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Thank you for your contribution @arnabnandy7! We will review the pull request and get back to you soon. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates azure-core GraalVM Native Image reachability metadata to avoid forcing SLF4J/logging classes to initialize at image build time, addressing native-image compilation failures seen with SLF4J 2 + Spring Boot 4.1 + GraalVM 25 (Issue #49844).
Changes:
- Removed
--initialize-at-build-timedirectives for SLF4J, Logback, Log4j, and Azure Core logging classes fromazure-corenative-image metadata. - Documented the intended GraalVM Native Image logging initialization behavior in the Azure Core README.
- Added a changelog entry describing the native-image compilation fix.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| sdk/core/azure-core/src/main/resources/META-INF/native-image/com.azure/azure-core/native-image.properties | Removes build-time init rules for logging-related classes to allow provider discovery at runtime. |
| sdk/core/azure-core/README.md | Adds guidance about GraalVM Native Image behavior for logging initialization. |
| sdk/core/azure-core/CHANGELOG.md | Records the native-image logging initialization fix under Bugs Fixed. |
arnabnandy7
force-pushed
the
fix/native-image-slf4j-fallback
branch
from
July 17, 2026 08:45
c5d2593 to
18167cd
Compare
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
arnabnandy7
force-pushed
the
fix/native-image-slf4j-fallback
branch
from
July 17, 2026 09:25
18167cd to
f3053a0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #49844.
This pull request fixes GraalVM Native Image compilation failures involving SLF4J 2 and Spring Boot 4.1.
Azure Core's native-image metadata previously forced SLF4J, logging providers, and Azure Core logging classes to initialize at image build time. With GraalVM 25, this could place SLF4J fallback providers such as
SubstituteServiceProviderandNOP_FallbackServiceProviderin the image heap while those classes were configured for runtime initialization.This change:
No public APIs are changed.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines
The change affects packaged GraalVM reachability metadata and does not introduce executable Java logic suitable for a unit test. Validation performed:
Built the Azure Core package successfully on Java 21:
Inspected the packaged native-image.properties and confirmed it no longer contains build-time initialization directives for SLF4J, Logback, Log4j, or Azure Core logging classes.