What is the difference between putting a property on application.yml or bootstrap.yml in spring boot? In logging.config case, the application works different.
Well, I totally agree with answers already exist on this point:
bootstrap.yml is used to save parameters that point out where the remote configuration is and Bootstrap Application Context is created with these remote configuration.Actually, it is also able to store normal properties just the same as what application.yml do. But pay attention on this tricky thing:
bootstrap.yml, they will get lower precedence than almost any other property sources, including application.yml. As described here.Let's make it clear, there are two kinds of properties related to bootstrap.yml:
bootstrap.yml to find the properties holder (A file system, git repository or something else), and the properties we get in this way are with high precedence, so they cannot be overridden by local configuration. As described here.bootstrap.yml. As explained early, they will get lower precedence. Use them to set defaults maybe a good idea.So the differences between putting a property on application.yml or bootstrap.yml in spring boot are:
bootstrap.yml.application.yml will get higher precedence.