Skip to content

Commit 7c0ccdf

Browse files
committed
Log allocated port when Livereload server is using an ephemeral port
Closes gh-31983
1 parent 1614941 commit 7c0ccdf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/OptionalLiveReloadServer.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,11 @@ public void afterPropertiesSet() throws Exception {
5252
void startServer() {
5353
if (this.server != null) {
5454
try {
55+
int port = this.server.getPort();
5556
if (!this.server.isStarted()) {
56-
this.server.start();
57+
port = this.server.start();
5758
}
58-
logger.info(LogMessage.format("LiveReload server is running on port %s", this.server.getPort()));
59+
logger.info(LogMessage.format("LiveReload server is running on port %s", port));
5960
}
6061
catch (Exception ex) {
6162
logger.warn("Unable to start LiveReload server");

0 commit comments

Comments
 (0)