From e68219c1acf6f3e3b49faa4e0b49eb02465b2e13 Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Tue, 5 Oct 2021 12:12:17 +0100 Subject: [PATCH] ResponseStatusExceptionHandler logs exception message only No need to log the full exception for a resolved exception, and as the comment suggests that it mirrors Spring MVC equivalent, which also logs the message only. --- .../web/server/handler/ResponseStatusExceptionHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-web/src/main/java/org/springframework/web/server/handler/ResponseStatusExceptionHandler.java b/spring-web/src/main/java/org/springframework/web/server/handler/ResponseStatusExceptionHandler.java index 52074e66f94..618200530e0 100644 --- a/spring-web/src/main/java/org/springframework/web/server/handler/ResponseStatusExceptionHandler.java +++ b/spring-web/src/main/java/org/springframework/web/server/handler/ResponseStatusExceptionHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,7 +70,7 @@ public class ResponseStatusExceptionHandler implements WebExceptionHandler { // Mirrors AbstractHandlerExceptionResolver in spring-webmvc... String logPrefix = exchange.getLogPrefix(); if (this.warnLogger != null && this.warnLogger.isWarnEnabled()) { - this.warnLogger.warn(logPrefix + formatError(ex, exchange.getRequest()), ex); + this.warnLogger.warn(logPrefix + formatError(ex, exchange.getRequest())); } else if (logger.isDebugEnabled()) { logger.debug(logPrefix + formatError(ex, exchange.getRequest()));