Support error.include-stacktrace configuration

Add `error.include-stacktrace` configuration option to determine when
stack trace attributes should be added. Options are `never`, `always`
or `on-trace-param`.

Prior to this commit stacktrace attributes were never includes in HTML
responses, and only included in JSON responses when a `trace` request
parameter was set to `true`. This has now been changed so that,
by default, stacktrace attributes are never included.

The BasicErrorController includes a protected method that can be
overridden if includes should be different depending on the `produces`
mapping.

Closes gh-2371
This commit is contained in:
Michael Stummvoll
2015-01-16 11:07:00 +01:00
committed by Phillip Webb
parent f918bf9c11
commit a1e0f01103
6 changed files with 252 additions and 52 deletions

View File

@@ -136,6 +136,10 @@ content into your application; rather pick only the properties that you need.
server.undertow.io-threads= # number of I/O threads to create for the worker
server.undertow.worker-threads= # number of worker threads
# ERROR HANDLING ({sc-spring-boot-autoconfigure}/web/ErrorProperties.{sc-ext}[ErrorProperties])
error.path=/error # the error path
error.include-stacktrace=never # when to include a stacktrace attribute (never/alway/on-trace-param)
# SPRING MVC ({sc-spring-boot-autoconfigure}/web/WebMvcProperties.{sc-ext}[WebMvcProperties])
spring.mvc.locale= # set fixed locale, e.g. en_UK
spring.mvc.date-format= # set fixed date format, e.g. dd/MM/yyyy