Skip to content

Commit 7d59957

Browse files
committed
Improve setEnvironmentPrefix(...) reference documentation
Closes gh-45370
1 parent a37d06a commit 7d59957

File tree

1 file changed

+5
-2
lines changed
  • spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/features

1 file changed

+5
-2
lines changed

spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/features/external-config.adoc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -721,9 +721,12 @@ If `max` is provided, then `value` is the minimum value and `max` is the maximum
721721

722722
Spring Boot supports setting a prefix for environment properties.
723723
This is useful if the system environment is shared by multiple Spring Boot applications with different configuration requirements.
724-
The prefix for system environment properties can be set directly on javadoc:org.springframework.boot.SpringApplication[].
724+
The prefix for system environment properties can be set directly on javadoc:org.springframework.boot.SpringApplication[] by calling the `setEnvironmentPrefix(...)` method before the application is run.
725725

726-
For example, if you set the prefix to `input`, a property such as `remote.timeout` will also be resolved as `input.remote.timeout` in the system environment.
726+
For example, if you set the prefix to `input`, a property such as `remote.timeout` will be resolved as `INPUT_REMOTE_TIMEOUT` in the system environment.
727+
728+
NOTE: The prefix _only_ applies to system environment properties.
729+
The example above would continue to use `remote.timeout` when reading properties from other sources.
727730

728731

729732

0 commit comments

Comments
 (0)