I run a Spring Boot application as a .jar file which partly takes its properties from application.yml residing inside the jar while the other part of properties is being provided from another application.yml residing outside the jar. Some of the properties from the outside overwrite the properties from the inside. In order to test whether the properties were overwritten properly I would like to see the currently active ones. Is that achieveable at all out of the box? Or is the only solution to extend my application by property output logic?
At least as of spring boot 2.0 actuator/env
will return the list of all properties per propertySources
in order of their precedence, ie. if a property is redefined in >1 sources then the 1st occurrence reading from the top is the one that is active.
For a single property actuator/env/<property-name>
will return the effective value and in which source it's defined
{
"property": {
"source": "applicationConfig: [file:../application-tom.properties]",
"value": "DEBUG"
},
...
}
Note: I dont know if this would reflect any changes that might happen when programmatically modifying the spring context. But that is smth. one should not do anyhow.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With