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.
This commit is contained in:
Rossen Stoyanchev 2021-10-05 12:12:17 +01:00
parent 151852b164
commit e68219c1ac
1 changed files with 2 additions and 2 deletions

View File

@ -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()));