Skip to content

Commit 6cb7fb5

Browse files
committed
Add info log message if AOT mode is enabled
Closes gh-32396
1 parent 4700a00 commit 6cb7fb5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java

+10
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ private void prepareContext(DefaultBootstrapContext bootstrapContext, Configurab
385385
if (this.logStartupInfo) {
386386
logStartupInfo(context.getParent() == null);
387387
logStartupProfileInfo(context);
388+
logStartupAotMode();
388389
}
389390
// Add boot specific singleton beans
390391
ConfigurableListableBeanFactory beanFactory = context.getBeanFactory();
@@ -640,6 +641,15 @@ protected void logStartupProfileInfo(ConfigurableApplicationContext context) {
640641
}
641642
}
642643

644+
/**
645+
* Called to log the AOT mode.
646+
*/
647+
protected void logStartupAotMode() {
648+
if (AotDetector.useGeneratedArtifacts()) {
649+
logger.info("AOT mode enabled");
650+
}
651+
}
652+
643653
private List<String> quoteProfiles(String[] profiles) {
644654
return Arrays.stream(profiles).map((profile) -> "\"" + profile + "\"").toList();
645655
}

0 commit comments

Comments
 (0)