Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add native image support for Log4J integration #46410

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

Open
ppkarwasz wants to merge 6 commits into spring-projects:main
base: main
Choose a base branch
Loading
from ppkarwasz:fix/42273_spring-log4j-runtime-hints

Conversation

Copy link
Contributor

@ppkarwasz ppkarwasz commented Jul 12, 2025

This change introduces AOT runtime hints for Log4j Core 2 to support its integration with Spring Boot native images.

Starting with version 2.25.0, Log4j Core 2 includes built-in GraalVM reachability metadata, allowing native image generation without requiring additional manual configuration.

This contribution complements that by adding Spring Boot–specific metadata:

  • Registers default Spring Boot configuration files.
  • Registers classes referenced via ClassUtils.isPresent(...) checks.

Fixes #42273.

Note

This change should be reviewed in conjunction with #46334, which configures Log4j Core’s GraalVmProcessor to generate reachability metadata for Spring Boot’s custom Log4j plugins.

This change introduces AOT runtime hints for Log4j Core 2 to support its integration with Spring Boot native images.
Starting with version `2.25.0`, Log4j Core 2 includes built-in GraalVM reachability metadata, allowing native image generation without requiring additional manual configuration.
This contribution complements that by adding Spring Boot–specific metadata:
* Registers default Spring Boot configuration files.
* Registers classes referenced via `ClassUtils.isPresent(...)` checks.
Fixes spring-projects#42273.
> [!NOTE]
> This change should be reviewed in conjunction with spring-projects#46334, which configures Log4j Core’s `GraalVmProcessor` to generate reachability metadata for Spring Boot’s custom Log4j plugins.
Signed-off-by: Piotr P. Karwasz <piotr@github.copernik.eu>
ppkarwasz added 5 commits July 12, 2025 21:14
Signed-off-by: Piotr P. Karwasz <piotr@github.copernik.eu>
Signed-off-by: Piotr P. Karwasz <piotr@github.copernik.eu>
Signed-off-by: Piotr P. Karwasz <piotr@github.copernik.eu>
Signed-off-by: Piotr P. Karwasz <piotr@github.copernik.eu>
Signed-off-by: Piotr P. Karwasz <piotr@github.copernik.eu>
@snicoll snicoll changed the title (削除) Add AOT runtime hints for Log4j Core 2 (削除ここまで) (追記) Add native image support for Log4J integration (追記ここまで) Aug 20, 2025
@snicoll snicoll added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 20, 2025
@snicoll snicoll added this to the 4.0.x milestone Aug 20, 2025
Copy link
Contributor

Blocked on #46334.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
status: blocked An issue that's blocked on an external project change type: enhancement A general enhancement
Projects
None yet
Milestone
4.0.x
Development

Successfully merging this pull request may close these issues.

Log4j2 classpath resource not found when using Spring Boot and GraalVM

AltStyle によって変換されたページ (->オリジナル) /