Skip to content

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]>
@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
@mhalbritter mhalbritter self-assigned this Aug 29, 2025
@mhalbritter
Copy link
Contributor

Blocked on #46334.

@mhalbritter mhalbritter added the status: blocked An issue that's blocked on an external project change label Aug 29, 2025
@mhalbritter mhalbritter removed their assignment Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: blocked An issue that's blocked on an external project change type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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