Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include default Dev Tools properties in the reference documentation #29406

Closed
vpavic opened this issue Jan 14, 2022 · 1 comment
Closed

Include default Dev Tools properties in the reference documentation #29406

vpavic opened this issue Jan 14, 2022 · 1 comment
Assignees
Labels
type: documentation A documentation update
Milestone

Comments

@vpavic
Copy link
Contributor

vpavic commented Jan 14, 2022

At the moment Dev Tools are configuring the following properties:

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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 14, 2022
@philwebb philwebb added the for: team-meeting An issue we'd like to discuss as a team to make progress label Jan 14, 2022
@philwebb
Copy link
Member

philwebb commented Feb 3, 2022

We discussed this issue today and we'd like to extend our documentation to list the properties that are set. We think we can do this by extracting them to a .properties file that we can also use to generate and .adoc file. We think this might be better than logging the properties since there's quite a few of them and it could get annoying.

We think that the server.error.* and spring.h2.console.enabled properties still make sense to have in a "developer only" setup. They're generally useful and we think they're worth setting by default.

@philwebb philwebb added type: documentation A documentation update and removed status: waiting-for-triage An issue we've not yet triaged for: team-meeting An issue we'd like to discuss as a team to make progress labels Feb 3, 2022
@philwebb philwebb added this to the 2.5.x milestone Feb 3, 2022
@wilkinsona wilkinsona changed the title Review default Dev Tools properties Include default Dev Tools properties in the reference documentation Feb 3, 2022
@wilkinsona wilkinsona self-assigned this Mar 10, 2022
@wilkinsona wilkinsona modified the milestones: 2.5.x, 2.5.11 Mar 11, 2022
wilkinsona added a commit that referenced this issue Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation A documentation update
Projects
None yet
Development

No branches or pull requests

4 participants