Is there a way to get list of loaded properties file in SpringBoot application?
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
Yes, but there is an important detail: Spring Boot does not think only in terms of "loaded properties files." It builds an ordered list of PropertySource objects, and some of those come from files while others come from environment variables, system properties, command-line arguments, or external configuration imports.
The key concept is PropertySource
If you want to see where configuration came from, inspect the Spring Environment. In a Boot application, that environment contains a chain of property sources in precedence order.
That means the answer is usually not "give me the exact file list" but "show me the property sources that are currently active." Some of those sources represent files such as application.properties or application.yml, while others do not correspond to files at all.
Listing active property sources
The simplest approach is to inject ConfigurableEnvironment and print its property sources at startup:
This will show sources such as system properties, environment variables, command-line arguments, and file-based config data. The exact names depend on your Spring Boot version and configuration setup.
Focusing on file-backed configuration
If you care mostly about property files, you can filter for sources whose names suggest config data or whose implementation type is file-backed:
This is not a perfect API guarantee, but it is often enough for debugging startup configuration and seeing which config files Boot actually loaded.
Using Actuator to inspect configuration
If you already use Spring Boot Actuator, the env endpoint can help you inspect effective configuration values and their origins. In a trusted environment, you can expose the endpoint:
Then query it:
This is useful when you need runtime visibility without adding temporary logging code. Be careful with security, though, because configuration endpoints can reveal sensitive operational details.
Why the file list can be incomplete or surprising
Spring Boot configuration may come from several places:
- '
application.propertiesorapplication.ymlon the classpath' - external files passed through
spring.config.location - additional files from
spring.config.additional-location - profile-specific files such as
application-prod.yml - environment variables and system properties
Because of that, there is not always a one-to-one mapping between the final environment and a set of plain .properties files. The application may be using YAML, imported config trees, or non-file sources that override file values.
Common Pitfalls
- Expecting every property source to correspond to a physical
.propertiesfile. - Assuming the source names are identical across all Spring Boot versions.
- Looking only at classpath config and forgetting external locations or active profiles.
- Exposing Actuator configuration endpoints in production without proper access control.
Summary
- The practical way to inspect loaded config in Spring Boot is to list
Environmentproperty sources. - Some property sources come from files, while others come from environment variables or runtime arguments.
- '
ConfigurableEnvironment#getPropertySources()is the simplest programmatic entry point.' - Actuator can help inspect active configuration, but it should be exposed carefully.

