Fine tune WebFlux server logging verbosity

With this commit, WebFlux server uses warning instead of error log level
for request handling, and also just print the message instead of the
stacktrace which is mostly meaningless in reactive world.

Complementary to this change, Reactor Netty removed additional logging
as part of https://github.com/reactor/reactor-netty/issues/339.

Issue: SPR-16688
This commit is contained in:
sdeleuze 2018-04-27 10:32:56 +02:00
parent 5b8c6c46e1
commit 75a41db071
3 changed files with 3 additions and 3 deletions

View File

@ -73,7 +73,7 @@ public class ReactorHttpHandlerAdapter implements BiFunction<HttpServerRequest,
}
return this.httpHandler.handle(adaptedRequest, adaptedResponse)
.doOnError(ex -> logger.error("Handling completed with error", ex))
.doOnError(ex -> logger.warn("Handling completed with error: " + ex.getMessage()))
.doOnSuccess(aVoid -> logger.debug("Handling completed with success"));
}

View File

@ -279,7 +279,7 @@ public class ServletHttpHandlerAdapter implements Servlet {
@Override
public void onError(Throwable ex) {
logger.error("Handling completed with error", ex);
logger.warn("Handling completed with error: " + ex.getMessage());
runIfAsyncNotComplete(this.asyncContext, this.isCompleted, () -> {
if (this.asyncContext.getResponse().isCommitted()) {
logger.debug("Dispatching into container to raise error");

View File

@ -97,7 +97,7 @@ public class UndertowHttpHandlerAdapter implements io.undertow.server.HttpHandle
@Override
public void onError(Throwable ex) {
logger.error("Handling completed with error", ex);
logger.warn("Handling completed with error: " + ex.getMessage());
if (this.exchange.isResponseStarted()) {
try {
logger.debug("Closing connection");