🔴 The Error You're Seeing
Confirm this matches your console output. If it does, you're in the right place.
2026-02-20 23:15:22.410 ERROR 8842 --- [ main] o.s.boot.SpringApplication : Application run failed
java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.joran.spi.ConsoleTarget@1 - [...] no applicable action for [springProfile], current ElementPath is [[configuration][springProfile]]
at org.springframework.boot.logging.logback.SpringBootJoranConfigurator.doConfigure(SpringBootJoranConfigurator.java:58)⚡ Quick Fix Works 80% of the time
Rename logback.xml to logback-spring.xml to enable Spring Boot's custom Logback extensions.
# Rename file
mv src/main/resources/logback.xml src/main/resources/logback-spring.xml🧠 Why this Happens
Tap to expand the deep technical explanation
You used a Spring Boot-specific Logback tag (like `<springProfile>` or `<springProperty>`) inside a file named `logback.xml`. Standard Logback parses `logback.xml` very early in the startup process, before Spring Boot is initialized, so it doesn't understand Spring's custom tags and throws a configuration error.
The HITEC City Parking Spot Analogy:
It's like using a microwave-specific container in a conventional oven. The oven (Standard Logback) doesn't recognize the container's symbols and refuses to cook. You must move it to the correct appliance (logback-spring.xml).
🔁 How to Reproduce Confirm this is your error
Create a `logback.xml` file in `src/main/resources/`. Add a `<springProfile name="dev">` tag inside it. Run the Spring Boot app.
🛠️ Solutions (5 Ways to Fix)
Rename to logback-spring.xml
👉 Use this as the primary fix if you use Spring Boot specific tags.
Spring Boot intercepts `logback-spring.xml` and parses it with its custom configurator, which understands `<springProfile>`.
# File: src/main/resources/logback-spring.xml
<configuration>
<springProfile name="dev">
<root level="DEBUG"/>
</springProfile>
</configuration>Remove Spring Boot specific tags
👉 Use this if you must use `logback.xml` for legacy reasons.
If you keep the file named `logback.xml`, you cannot use `<springProfile>` or `<springProperty>`. Use standard Logback syntax.
<!-- logback.xml -->
<configuration>
<!-- No <springProfile> tags allowed -->
<root level="DEBUG"/>
</configuration>Fix XML syntax errors
👉 Use this if the 'no applicable action' error refers to a standard tag.
Check for typos in standard tags like `<appender>` or `<encoder>`. Ensure they are correctly nested.
<!-- Check for typos -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss} %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>Validate XML schema
👉 Use this if the file is complex and hard to debug.
Use an online XML validator or IDE tool to ensure the document is well-formed.
// IntelliJ: Code -> Inspect Code -> XML validationDelete the file and use application.properties
👉 Use this if you only need basic logging configuration.
Spring Boot can configure logging entirely via properties, avoiding XML entirely.
# application.properties
logging.level.com.devinhyderabad=DEBUG
logging.file.name=app.log📋 Version Notes
Parses logback.xml early, logback-spring.xml later.
Strictly enforces the distinction. Throws errors immediately for Spring tags in logback.xml.
🛡️ How to Prevent This Next Time
Always name your Logback configuration file `logback-spring.xml` in Spring Boot projects to ensure Spring's custom tags are parsed correctly.