Prevent stack trace logging for custom exception in Spring Boot application

前端 未结 4 1143
走了就别回头了
走了就别回头了 2021-02-01 17:06

Is there a way in Spring Boot (mvc) to log a custom exception and throw it without its stack trace being visible in the log file? But for any other exception st

4条回答
  •  名媛妹妹
    2021-02-01 17:26

    Be wary of Spring Boot DevTools.

    Despite NEVER being the default for server.error.include-stacktrace, if you include Spring Boot DevTools it overides to ALWAYS.

    If you're interested in more detail, see this commit, which became part of Spring Boot 2.1.0+

提交回复
热议问题