In this short article, we will present how to log all system properties on Spring Boot startup.
In Spring Boot applications the
Environment is an interface representing the environment in which the current application is running.
We can use that interface to get active profiles and properties of the application environment.
The following code will print all properties from the environment:
Note that the
Environment object could be autowired in Spring Boot components just like other Spring beans.
The following code prints several environment properties on startup:
In this short article, we presented how to print all the important environment information on Spring Boot startup.