Skip to content

Commit 76f192d

Browse files
Don't use logging on failed start
There is a good change that logging has not been setup yet, and the logging will not be written out. A better approach would probable be to register a shutdown hook in the delayed log handler to make sure the messages are written out before exit, but this is better than nothing.
1 parent e299fed commit 76f192d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedDevModeMain.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,15 @@ private synchronized void firstStart() {
132132
}
133133
} catch (Exception e) {
134134
close();
135-
log.error("Failed to start quarkus", t);
136-
log.error("Failed to recover after failed start", e);
135+
// Don't use logs here, as logging might not be setup yet
136+
// Resulting in a silent exit
137+
System.err.println("Failed to start quarkus");
138+
t.printStackTrace();
139+
System.err.println("Failed to recover after failed start");
140+
e.printStackTrace();
137141
//this is the end of the road, we just exit
138142
//generally we only hit this if something is already listening on the HTTP port
139-
//or the system config is so broken we can't start HTTP
143+
//or the system config is so broken we can't start HTTP]
140144
System.exit(1);
141145
}
142146
}

0 commit comments

Comments
 (0)