From 27446498925ff9748669860985c17441a5f3883d Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 11 May 2022 10:11:16 +0100 Subject: [PATCH] Update started log message as app may not be running on a JVM Closes gh-30974 --- .../src/docs/asciidoc/features/spring-application.adoc | 2 +- .../src/docs/asciidoc/getting-started/first-application.adoc | 4 ++-- .../spring-boot-docs/src/docs/asciidoc/using/devtools.adoc | 2 +- .../main/java/org/springframework/boot/StartupInfoLogger.java | 4 ++-- .../java/org/springframework/boot/StartupInfoLoggerTests.java | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/spring-application.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/spring-application.adoc index a717c74463..8224b38ac1 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/spring-application.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/spring-application.adoc @@ -26,7 +26,7 @@ When your application starts, you should see something similar to the following 2021-02-03 10:33:26.097 INFO 17900 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 821 ms 2021-02-03 10:33:26.144 INFO 17900 --- [ main] s.tomcat.SampleTomcatApplication : ServletContext initialized 2021-02-03 10:33:26.376 INFO 17900 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '' -2021-02-03 10:33:26.384 INFO 17900 --- [ main] o.s.b.d.s.s.SpringApplicationExample : Started SampleTomcatApplication in 1.514 seconds (JVM running for 1.823) +2021-02-03 10:33:26.384 INFO 17900 --- [ main] o.s.b.d.s.s.SpringApplicationExample : Started SampleTomcatApplication in 1.514 seconds (process running for 1.823) ---- diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/first-application.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/first-application.adoc index 7aeb30ecde..3aadd4d53d 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/first-application.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/first-application.adoc @@ -207,7 +207,7 @@ You should see output similar to the following: ....... . . . ....... . . . (log output here) ....... . . . - ........ Started MyApplication in 2.222 seconds (JVM running for 6.514) + ........ Started MyApplication in 2.222 seconds (process running for 6.514) ---- If you open a web browser to `http://localhost:8080`, you should see the following output: @@ -307,7 +307,7 @@ To run that application, use the `java -jar` command, as follows: ....... . . . ....... . . . (log output here) ....... . . . - ........ Started MyApplication in 2.536 seconds (JVM running for 2.864) + ........ Started MyApplication in 2.536 seconds (process running for 2.864) ---- As before, to exit the application, press `ctrl-c`. diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/using/devtools.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/using/devtools.adoc index d3cc70641c..3611581545 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/using/devtools.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/using/devtools.adoc @@ -402,7 +402,7 @@ A running remote client might resemble the following listing: 2015-06-10 18:25:06.671 INFO 14938 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@2a17b7b6: startup date [Wed Jun 10 18:25:06 PDT 2015]; root of context hierarchy 2015-06-10 18:25:07.043 WARN 14938 --- [ main] o.s.b.d.r.c.RemoteClientConfiguration : The connection to http://localhost:8080 is insecure. You should use a URL starting with 'https://'. 2015-06-10 18:25:07.074 INFO 14938 --- [ main] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729 - 2015-06-10 18:25:07.130 INFO 14938 --- [ main] o.s.b.devtools.RemoteSpringApplication : Started RemoteSpringApplication in 0.74 seconds (JVM running for 1.105) + 2015-06-10 18:25:07.130 INFO 14938 --- [ main] o.s.b.devtools.RemoteSpringApplication : Started RemoteSpringApplication in 0.74 seconds (process running for 1.105) ---- NOTE: Because the remote client is using the same classpath as the real application it can directly read application properties. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/StartupInfoLogger.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/StartupInfoLogger.java index aa79a5c65e..7b1c39b054 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/StartupInfoLogger.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/StartupInfoLogger.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -92,7 +92,7 @@ class StartupInfoLogger { message.append(" seconds"); try { double uptime = ManagementFactory.getRuntimeMXBean().getUptime() / 1000.0; - message.append(" (JVM running for ").append(uptime).append(")"); + message.append(" (process running for ").append(uptime).append(")"); } catch (Throwable ex) { // No JVM time available diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/StartupInfoLoggerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/StartupInfoLoggerTests.java index f3477ceb56..6c03f7c6d5 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/StartupInfoLoggerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/StartupInfoLoggerTests.java @@ -61,7 +61,7 @@ class StartupInfoLoggerTests { ArgumentCaptor captor = ArgumentCaptor.forClass(Object.class); then(this.log).should().info(captor.capture()); assertThat(captor.getValue().toString()).matches("Started " + getClass().getSimpleName() - + " in \\d+\\.\\d{1,3} seconds \\(JVM running for \\d+\\.\\d{1,3}\\)"); + + " in \\d+\\.\\d{1,3} seconds \\(process running for \\d+\\.\\d{1,3}\\)"); } }