From e95bb1c46c85fe697d9793c0bb1d7eead313f1bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Mon, 23 Jan 2023 08:58:21 +0100 Subject: [PATCH] More logs on tile download error --- .../java/org/mapfish/print/map/tiled/CoverageTask.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/mapfish/print/map/tiled/CoverageTask.java b/core/src/main/java/org/mapfish/print/map/tiled/CoverageTask.java index 1ad65687aa..a7154b3d0a 100644 --- a/core/src/main/java/org/mapfish/print/map/tiled/CoverageTask.java +++ b/core/src/main/java/org/mapfish/print/map/tiled/CoverageTask.java @@ -16,6 +16,7 @@ import org.mapfish.print.processor.Processor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.client.ClientHttpRequest; import org.springframework.http.client.ClientHttpResponse; @@ -228,8 +229,13 @@ protected Tile compute() { return new Tile(null, getTileIndexX(), getTileIndexY()); } else if (statusCode != HttpStatus.OK) { String errorMessage = String.format( - "Error making tile request: %s\n\tStatus: %s\n\toutMessage: %s", + "Error making tile request: %s\n\tStatus: %s\n\tStatus message: %s", this.tileRequest.getURI(), statusCode, response.getStatusText()); + LOGGER.debug(String.format( + "Error making tile request: %s\nStatus: %s\n" + + "Status message: %s\nServer:%s\nBody:\n%s", + this.tileRequest.getURI(), statusCode, response.getStatusText(), + response.getHeaders().getFirst(HttpHeaders.SERVER), response.getBody())); this.registry.counter(baseMetricName + ".error").inc(); if (this.failOnError) { throw new RuntimeException(errorMessage);