@Test public void logsThrowables() { Exception exception = new Exception("This is just a test"); httpErrorStatusCauseLogger.proxyErrorOccurred(INTERNAL_SERVER_ERROR, exception); assertThat(loggingTestSupport.log(), hasItem( loggingEvent( ERROR, "Failure status=\"500 Internal Server Error\"", "java.lang.Exception", "This is just a test"))); }
@Override public void proxyErrorOccurred(HttpResponseStatus status, Throwable cause) { if (status.code() > 500) { LOG.error("Failure status=\"{}\", exception=\"{}\"", status, withoutStackTrace(cause)); } else { LOG.error("Failure status=\"{}\"", status, cause); } }
HttpErrorStatusCauseLogger implements HttpErrorStatusListener { @Override public void proxyErrorOccurred(HttpResponseStatus status, Throwable cause) { if (status.code() > 500) { LOG.error("Failure status=\"{}\", exception=\"{}\"", status, withoutStackTrace(cause)); } else { LOG.error("Failure status=\"{}\"", status, cause); } } }
HttpErrorStatusCauseLogger implements HttpErrorStatusListener { @Override public void proxyErrorOccurred(HttpResponseStatus status, Throwable cause) { if (status.code() > 500) { LOG.error("Failure status=\"{}\", exception=\"{}\"", status, withoutStackTrace(cause)); } else { LOG.error("Failure status=\"{}\"", status, cause); } } HttpErrorStatusCauseLogger(HttpMessageFormatter formatter); }
HttpErrorStatusCauseLogger implements HttpErrorStatusListener { @Override public void proxyErrorOccurred(HttpResponseStatus status, Throwable cause) { if (status.code() > 500) { LOG.error("Failure status=\"{}\", exception=\"{}\"", status, withoutStackTrace(cause)); } else { LOG.error("Failure status=\"{}\"", status, cause); } } HttpErrorStatusCauseLogger(HttpMessageFormatter formatter); @Override void proxyErrorOccurred(HttpResponseStatus status, Throwable cause); @Override void proxyErrorOccurred(LiveHttpRequest request, InetSocketAddress clientAddress, HttpResponseStatus status, Throwable cause); @Override void proxyErrorOccurred(Throwable cause); @Override void proxyWriteFailure(LiveHttpRequest request, LiveHttpResponse response, Throwable cause); @Override void proxyingFailure(LiveHttpRequest request, LiveHttpResponse response, Throwable cause); }
HttpErrorStatusCauseLogger implements HttpErrorStatusListener { @Override public void proxyErrorOccurred(HttpResponseStatus status, Throwable cause) { if (status.code() > 500) { LOG.error("Failure status=\"{}\", exception=\"{}\"", status, withoutStackTrace(cause)); } else { LOG.error("Failure status=\"{}\"", status, cause); } } HttpErrorStatusCauseLogger(HttpMessageFormatter formatter); @Override void proxyErrorOccurred(HttpResponseStatus status, Throwable cause); @Override void proxyErrorOccurred(LiveHttpRequest request, InetSocketAddress clientAddress, HttpResponseStatus status, Throwable cause); @Override void proxyErrorOccurred(Throwable cause); @Override void proxyWriteFailure(LiveHttpRequest request, LiveHttpResponse response, Throwable cause); @Override void proxyingFailure(LiveHttpRequest request, LiveHttpResponse response, Throwable cause);  }