SpringBoot with LogBack creating LOG_PATH_IS_UNDEFINED folder
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
If Spring Boot with Logback creates a folder named LOG_PATH_IS_UNDEFINED, it usually means your Logback configuration expects a log-path property that was never actually set. Logback then resolves the missing property to the literal fallback token and happily creates that directory.
This is not really a Logback bug. It is almost always a configuration mismatch between your logback.xml or logback-spring.xml file and the Spring Boot logging properties you thought were available.
Why the Folder Appears
A common Logback pattern looks like this:
If LOG_PATH does not exist in the environment or in Spring's resolved property sources at the time Logback parses the file, appenders that use ${LOG_PATH} may end up writing into a directory literally named LOG_PATH_IS_UNDEFINED.
That is the symptom telling you: the path variable was not resolved.
Use Spring-Aware Configuration When Needed
If you want to use Spring Boot properties such as values from application.properties or application.yml, prefer logback-spring.xml over plain logback.xml.
Example application.yml:
Example logback-spring.xml:
This works because logback-spring.xml understands Spring-specific extensions such as <springProperty>.
Plain logback.xml Has Fewer Options
If you use plain logback.xml, Spring Boot property resolution is more limited. That often leads people to think logging.file.path will magically populate a variable that Logback can read directly in every context.
It is safer to either:
- use
logback-spring.xmlwith Spring-aware property binding, or - define the required environment variable explicitly before startup
For example:
Verify the Property Name
Another common issue is mixing old and new property names. Depending on the Spring Boot version, examples on the internet may reference different logging properties, and copying them blindly causes confusion.
When the folder LOG_PATH_IS_UNDEFINED appears, inspect both sides:
- the property name you set in Spring Boot config
- the variable name Logback is actually trying to read
They often do not match.
Check the Working Directory Too
If the placeholder resolves badly and no absolute path is configured, the odd directory may appear under whatever working directory the application started from. That is why the folder sometimes shows up next to the JAR, inside a container work directory, or under an IDE project root instead of somewhere obviously "logging related."
Add a Safe Default if Appropriate
If the log path is optional in some environments, give it an explicit fallback rather than letting Logback invent one.
Or with Spring-aware config, provide a property that is always set per environment. The important thing is to choose the default on purpose instead of accepting an undefined placeholder.
Common Pitfalls
- Using
logback.xmlwhile expecting Spring Boot properties to behave likelogback-spring.xml. - Referring to
LOG_PATHin Logback without ever defining that variable. - Mixing property names from different Spring Boot versions or examples.
- Assuming the strange directory name is a filesystem bug instead of a missing-property clue.
- Omitting a sensible fallback path for environments where log-path configuration is optional.
Summary
- '
LOG_PATH_IS_UNDEFINEDusually means Logback expected a path property that was never resolved.' - Use
logback-spring.xmlif you want to bind values cleanly from Spring Boot configuration. - Check that the property name in Boot config matches the variable name Logback expects.
- Provide an intentional default path when appropriate.
- Treat the folder name as a configuration diagnostic, not as random Logback behavior.
Related reading
- SSH into Kubernetes cluster running on Amazon
- ssh remote host identification has changed
- SSH to Elastic Beanstalk instance
- Standard Commons Logging discovery in action with spring-jcl
- SpringBoot's MultipartConfig maxFileSize not taking effect
- SpringBootTest No qualifying bean of type 'org.springframework.test.web.servlet.MockMvc' available
- Start kubernetes container with specific command
- Start one pod at a time when replica is greater than one

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.