diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java index bfc411ee15..812929801e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java @@ -273,7 +273,16 @@ public abstract class AbstractErrorWebExceptionHandler implements ErrorWebExcept return (message.contains("broken pipe") || message.contains("connection reset by peer")); } - private void logError(ServerRequest request, ServerResponse response, Throwable throwable) { + /** + * Logs the {@code throwable} error for the given {@code request} and {@code response} + * exchange. The default implementation logs all errors at debug level. Additionally, + * any internal server error (500) is logged at error level. + * @param request the request that was being handled + * @param response the response that was being sent + * @param throwable the error to be logged + * @since 2.2.0 + */ + protected void logError(ServerRequest request, ServerResponse response, Throwable throwable) { if (logger.isDebugEnabled()) { logger.debug(request.exchange().getLogPrefix() + formatError(throwable, request)); }