Browse Source

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.
pull/28694/head
Rossen Stoyanchev 4 years ago
parent
commit
2fa44d62b9
  1. 4
      spring-web/src/main/java/org/springframework/web/server/handler/ResponseStatusExceptionHandler.java

4
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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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... // Mirrors AbstractHandlerExceptionResolver in spring-webmvc...
String logPrefix = exchange.getLogPrefix(); String logPrefix = exchange.getLogPrefix();
if (this.warnLogger != null && this.warnLogger.isWarnEnabled()) { 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()) { else if (logger.isDebugEnabled()) {
logger.debug(logPrefix + formatError(ex, exchange.getRequest())); logger.debug(logPrefix + formatError(ex, exchange.getRequest()));

Loading…
Cancel
Save