Skip to content

Add AOT runtime hints for Log4j Core 2 #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
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ppkarwasz
Copy link
Contributor

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 <[email protected]>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 12, 2025
Signed-off-by: Piotr P. Karwasz <[email protected]>
Signed-off-by: Piotr P. Karwasz <[email protected]>
Signed-off-by: Piotr P. Karwasz <[email protected]>
Signed-off-by: Piotr P. Karwasz <[email protected]>
Signed-off-by: Piotr P. Karwasz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Log4j2 classpath resource not found when using Spring Boot and GraalVM
2 participants