Browse Source

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
pull/1811/merge
sdeleuze 8 years ago
parent
commit
75a41db071
  1. 2
      spring-web/src/main/java/org/springframework/http/server/reactive/ReactorHttpHandlerAdapter.java
  2. 2
      spring-web/src/main/java/org/springframework/http/server/reactive/ServletHttpHandlerAdapter.java
  3. 2
      spring-web/src/main/java/org/springframework/http/server/reactive/UndertowHttpHandlerAdapter.java

2
spring-web/src/main/java/org/springframework/http/server/reactive/ReactorHttpHandlerAdapter.java

@ -73,7 +73,7 @@ public class ReactorHttpHandlerAdapter implements BiFunction<HttpServerRequest, @@ -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"));
}

2
spring-web/src/main/java/org/springframework/http/server/reactive/ServletHttpHandlerAdapter.java

@ -279,7 +279,7 @@ public class ServletHttpHandlerAdapter implements Servlet { @@ -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");

2
spring-web/src/main/java/org/springframework/http/server/reactive/UndertowHttpHandlerAdapter.java

@ -97,7 +97,7 @@ public class UndertowHttpHandlerAdapter implements io.undertow.server.HttpHandle @@ -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");

Loading…
Cancel
Save