Reading the startup log
35 min · Intermediate
Need help? Ask a tutor on WhatsApp (opens in a new tab)When an app will not start, guessing wastes hours. The first lines of the log already say which Java, port and profile ran, and the last lines say what broke.
Reading the startup log line by line
PID (process ID) is the number the operating system gives a running program. It appears in every log line, and you need it to stop that exact process with kill or taskkill.
A normal start of boot-lab: the banner, then the lines to look for, in order.
Example 1 · A normal start of boot-lab
Runs in: the boot-lab practice project (Spring Boot 4.1)
java -jar target/boot-lab-0.0.1-SNAPSHOT.jar. ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v4.1.1) 2026-10-16T10:52:46.851+05:30 INFO 3312 --- [boot-lab] [ main] com.shoplite.lab.BootLabApplication : Starting BootLabApplication v0.0.1-SNAPSHOT using Java 21.0.7 with PID 3312 (C:\Users\asha\boot-lab\target\boot-lab-0.0.1-SNAPSHOT.jar started by asha in C:\Users\asha\boot-lab) 2026-10-16T10:52:46.858+05:30 INFO 3312 --- [boot-lab] [ main] com.shoplite.lab.BootLabApplication : No active profile set, falling back to 1 default profile: "default" 2026-10-16T10:52:48.999+05:30 INFO 3312 --- [boot-lab] [ main] o.s.boot.tomcat.TomcatWebServer : Tomcat initialized with port 8080 (http) 2026-10-16T10:52:49.037+05:30 INFO 3312 --- [boot-lab] [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2026-10-16T10:52:49.037+05:30 INFO 3312 --- [boot-lab] [ main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/11.0.24] 2026-10-16T10:52:49.117+05:30 INFO 3312 --- [boot-lab] [ main] b.w.c.s.WebApplicationContextInitializer : Root WebApplicationContext: initialization completed in 2128 ms 2026-10-16T10:52:49.957+05:30 INFO 3312 --- [boot-lab] [ main] o.s.boot.tomcat.TomcatWebServer : Tomcat started on port 8080 (http) with context path '/' 2026-10-16T10:52:49.987+05:30 INFO 3312 --- [boot-lab] [ main] com.shoplite.lab.BootLabApplication : Started BootLabApplication in 4.074 seconds (process running for 5.294)
What this code does
- Line 1 after the banner: the app and its version, the Java version (21.0.7 here), the PID (process ID, the number
taskkillorkillneeds) and where it was started from. - Then the profile line, the three Tomcat lines with the port and the Tomcat version, the context being built ("initialization completed in 2128 ms"), Tomcat listening with its port and context path, and "Started ... in 4.074 seconds".
- Every line has the same columns: time, level, PID,
---, app name, thread in brackets, the shortened logger (class) name, then the message.o.s.bootis short fororg.springframework.boot.
The startup log is what Spring Boot prints while it starts: who is starting, with which Java and settings, how far it got, and how long it took. The lines to look for, in order: Starting ... using Java ... with PID ..., the profile line, Tomcat initialized with port, Root WebApplicationContext: initialization completed (your beans are being built), Tomcat started on port ... with context path, and Started ... in N seconds. Only after the last one is the app ready for requests.
The number after "Started in" is the time Spring took; "process running for" also includes JVM start-up. On a laptop 3 to 10 seconds is normal for a small app.
'No active profile set, falling back to 1 default profile'
A profile is a named set of settings, such as dev or prod, that you switch on when starting the app. With none switched on, Boot logs "No active profile set, falling back to 1 default profile": an INFO message, not an error.
Starting boot-lab with --spring.profiles.active=dev and watching the profile line change.
Example 2 · Starting with a profile
Runs in: the boot-lab practice project (Spring Boot 4.1)
java -jar target/boot-lab-0.0.1-SNAPSHOT.jar --spring.profiles.active=dev... com.shoplite.lab.BootLabApplication : The following 1 profile is active: "dev"
What this code does
- The second line of the log changes from "No active profile set, falling back to 1 default profile" to the list of active profiles.
- boot-lab has no
application-dev.propertiesyet, so nothing else changes. The Configuration, Profiles & Logging module adds real dev and prod settings to ShopLite.
The environment variable SPRING_PROFILES_ACTIVE=dev does the same, and Boot also reads application-dev.properties if it exists. The line matters when settings seem to be ignored: if your database URL lives in application-dev.properties and the log says "default", the dev file was never read. That is also why the DataSource failure's Action mentions activating a profile.
APPLICATION FAILED TO START: Description and Action
A failure analyzer is Boot's built-in explainer for known startup errors. It turns the exception into an APPLICATION FAILED TO START report with two parts: Description (what went wrong, in words) and Action (what to do).
A typo in application.properties, server.port=80a, and the report Boot prints.
Example 3 · A typo in application.properties: server.port=80a
Runs in: the boot-lab practice project (Spring Boot 4.1)
# src/main/resources/application.properties, line 2server.port=80a./mvnw packagejava -jar target/boot-lab-0.0.1-SNAPSHOT.jar...
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to bind properties under 'server.port' to java.lang.Integer:
Property: server.port
Value: "80a"
Origin: class path resource [application.properties] from boot-lab-0.0.1-SNAPSHOT.jar - 2:13
Reason: failed to convert java.lang.String to java.lang.Integer (caused by java.lang.NumberFormatException: For input string: "80a")
Action:
Update your application's configurationWhat this code does
- The Description names the property, the bad value, and its origin:
application.propertiesinside the jar, line 2, column 13. You can go straight to the line. - The Reason is the Java error underneath (
NumberFormatException: For input string: "80a"), already explained in words. - The Action is short because the fix is obvious: correct the value. For an enum setting such as
spring.main.banner-mode=ofthe Action even lists the valid values (CONSOLE,LOG,OFF).
Always read this block before anything else. You have already met several: a missing bean, a missing DataSource URL, a port in use, and a property with a bad value. The Description usually names the exact class, property or file, and sometimes the line.
The block appears at the end of the log, after any stack trace. In an IDE console, scroll to the bottom first.
Finding the root cause at the bottom of a long Caused by chain
The root cause is the original error at the bottom of an exception chain, the last Caused by: section. Everything above it describes the effect, because Spring wraps the error at every level.
A failed start with no Description or Action, and a grep that pulls out the summary lines of a saved log.
grep -E "Caused by|APPLICATION FAILED|Description|Action" app.logExample 4 · A missing environment variable, read from the bottom up
Runs in: the boot-lab practice project with the JDBC starter, without DB_URL set
# the boot-lab of the Auto-configuration lesson (JDBC starter, DatabaseCheck,# spring.datasource.url=${DB_URL}), started in a new terminal where DB_URL is not setjava -jar target/boot-lab-0.0.1-SNAPSHOT.jar2026-10-16T10:26:16.212+05:30 ERROR 14640 --- [boot-lab] [ main] o.s.boot.SpringApplication : Application run failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'databaseCheck' defined in URL [jar:nested:/C:/Users/asha/boot-lab/target/boot-lab-0.0.1-SNAPSHOT.jar/!BOOT-INF/classes/!/com/shoplite/lab/DatabaseCheck.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/jdbc/autoconfigure/DataSourceConfiguration$Hikari.class]: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception with message: 'url' must start with "jdbc" at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:804) ~[spring-beans-7.0.9.jar!/:7.0.9] at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:240) ~[spring-beans-7.0.9.jar!/:7.0.9] ... (about 25 more "at" lines) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/jdbc/autoconfigure/DataSourceConfiguration$Hikari.class]: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception with message: 'url' must start with "jdbc" at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:657) ~[spring-beans-7.0.9.jar!/:7.0.9] ... ... 26 common frames omitted Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception with message: 'url' must start with "jdbc" at org.springframework.beans.factory.support.SimpleInstantiationStrategy.lambda$instantiate$0(SimpleInstantiationStrategy.java:183) ~[spring-beans-7.0.9.jar!/:7.0.9] ... ... 40 common frames omitted Caused by: java.lang.IllegalArgumentException: 'url' must start with "jdbc" at org.springframework.util.Assert.isTrue(Assert.java:117) ~[spring-core-7.0.9.jar!/:7.0.9] at org.springframework.boot.jdbc.DatabaseDriver.fromJdbcUrl(DatabaseDriver.java:316) ~[spring-boot-jdbc-4.1.1.jar!/:4.1.1] at org.springframework.boot.jdbc.autoconfigure.DataSourceProperties.findDriverClassName(DataSourceProperties.java:193) ~[spring-boot-jdbc-4.1.1.jar!/:4.1.1] ... ... 43 common frames omitted
What this code does
- There is no Description/Action block this time: Boot had no ready explanation, so you get "Application run failed" and the exception chain, 87 lines in the real log.
- Each
Caused by:is one level deeper:databaseCheckcould not be created becausedataSourcecould not be created because Hikari could not be built because'url' must start with "jdbc". The last one is the root cause. - Why would a URL not start with jdbc? Because
${DB_URL}was not replaced: the variable is not set in this terminal, so the URL is the text${DB_URL}itself. Set the variable (or the IDE run configuration) and start again.
Java prints each wrapped exception as a Caused by: section with its own at ... lines, so a Spring startup error can be a hundred lines long. Read the last Caused by: first, then the first at line under it that points to your code, such as at com.shoplite.lab.GstCalculator.<init>(GstCalculator.java:15). In Windows PowerShell, Select-String -Path app.log -Pattern "Caused by","APPLICATION FAILED" does the job of the grep line.
"... 26 common frames omitted" is not missing information: those lines are the same as in the exception above and Java skips repeating them.
Find the bug
Find the root cause
Click the line that holds the root cause.
The app fails to start. Which line is the root cause?
Round 1 of 2Turning the banner off and making the log quieter
A log level is the importance of a log message: ERROR, WARN, INFO (Boot's default), DEBUG or TRACE. A setting such as logging.level.root=warn keeps that level and the more serious ones.
A quiet start: banner off, only warnings and errors, and a runner that prints one line.
Example 5 · GstCalculator.java, StartupNote.java: a quiet start
Runs in: the boot-lab practice project (Spring Boot 4.1)
// src/main/java/com/shoplite/lab/GstCalculator.javapackage com.shoplite.lab;
import java.math.BigDecimal;
import org.springframework.beans.factory.annotation.Value;import org.springframework.stereotype.Component;
@Componentpublic class GstCalculator {
private final BigDecimal rate;
public GstCalculator(@Value("${shoplite.gst-percent:18}") BigDecimal ratePercent) { if (ratePercent.signum() < 0 || ratePercent.compareTo(new BigDecimal("28")) > 0) { throw new IllegalStateException("GST percent must be between 0 and 28, got " + ratePercent); } this.rate = ratePercent; }
public BigDecimal rate() { return rate; }}
// src/main/java/com/shoplite/lab/StartupNote.javapackage com.shoplite.lab;
import org.springframework.boot.CommandLineRunner;import org.springframework.stereotype.Component;
@Componentpublic class StartupNote implements CommandLineRunner {
private final GstCalculator gst;
public StartupNote(GstCalculator gst) { this.gst = gst; }
@Override public void run(String... args) { System.out.println("boot-lab ready, GST " + gst.rate() + "%"); }}
# src/main/resources/application.propertiesspring.application.name=boot-labspring.main.banner-mode=offlogging.level.root=warnboot-lab ready, GST 18%
What this code does
- With the banner off and only warnings and errors logged, a successful start prints nothing but the runner's own line. A failure still shows in full, because it is logged at ERROR.
@Value("${shoplite.gst-percent:18}")reads a setting with 18 as the default. Start with--shoplite.gst-percent=180and the constructor throws; the bottomCaused by:isjava.lang.IllegalStateException: GST percent must be between 0 and 28, got 180, pointing atGstCalculator.java:15.- Quiet logging suits small labs and tests. A real server keeps INFO, because the startup lines are what you read when something goes wrong.
The banner is the large Spring logo at the top of the log. spring.main.banner-mode=off hides it; log sends it to the log instead of the console. logging.level.org.apache=warn would quieten only Tomcat's lines, and spring.main.log-startup-info=false drops just the "Starting" and "Started" lines.
Make the log quieter only where the noise is truly useless. The INFO startup lines answer "which version, which port, which profile, how long" in production, so ShopLite keeps INFO and adds its own short startup report in this module's project.
Next step
Check your understanding
11 quick questions