-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Description
At the moment Dev Tools are configuring the following properties:
Lines 63 to 78 in fe82098
Map<String, Object> properties = new HashMap<>(); | |
properties.put("spring.freemarker.cache", "false"); | |
properties.put("spring.groovy.template.cache", "false"); | |
properties.put("spring.mustache.cache", "false"); | |
properties.put("server.servlet.session.persistent", "true"); | |
properties.put("spring.h2.console.enabled", "true"); | |
properties.put("spring.web.resources.cache.period", "0"); | |
properties.put("spring.web.resources.chain.cache", "false"); | |
properties.put("spring.template.provider.cache", "false"); | |
properties.put("spring.mvc.log-resolved-exception", "true"); | |
properties.put("server.error.include-binding-errors", "ALWAYS"); | |
properties.put("server.error.include-message", "ALWAYS"); | |
properties.put("server.error.include-stacktrace", "ALWAYS"); | |
properties.put("server.servlet.jsp.init-parameters.development", "true"); | |
properties.put("spring.reactor.debug", "true"); | |
PROPERTIES = Collections.unmodifiableMap(properties); |
Some of those (server.error.include-*
) impact HTTP responses (either HTML or JSON) returned to the user which I find to be a bit controversial. IMO, something like Dev Tools shouldn't have impact to an application in functional way, which changing responses sort of is. I'd rather see such information being logged instead of returned in responses.
The similar case could be made for enabling H2 console, which most of the time also requires configuring security in order to be accessible.
Additionally, it might be worth considering to also provide more information about which exact properties were enabled. At the moment, only this is logged on startup.
2022-01-14 22:22:17.289 INFO 186000 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
Since the list might change over time, it might be a good idea to log exact properties that were set.