Prevent stack trace logging for custom exception in Spring Boot application

I’m using Spring Boot 2+
just add this line to your application.properties:

server.error.include-stacktrace=never

https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/autoconfigure/web/ErrorProperties.IncludeStacktrace.html

Leave a Comment