From 5c95d8877e24b2493b65776866bbb1d189839f4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Tue, 13 Feb 2024 15:38:21 +0100 Subject: [PATCH] Add some logs for debbuging --- .../java/org/mapfish/print/http/HttpRequestFetcher.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/mapfish/print/http/HttpRequestFetcher.java b/core/src/main/java/org/mapfish/print/http/HttpRequestFetcher.java index adc8c6d365..7eb04f74c5 100644 --- a/core/src/main/java/org/mapfish/print/http/HttpRequestFetcher.java +++ b/core/src/main/java/org/mapfish/print/http/HttpRequestFetcher.java @@ -92,8 +92,12 @@ private CachedClientHttpResponse(final ClientHttpResponse originalResponse) thro this.statusText = originalResponse.getStatusText(); this.cachedFile = File.createTempFile("cacheduri", null, HttpRequestFetcher.this.temporaryDirectory); + LOGGER.debug("Caching URI resource to {}", this.cachedFile); try (OutputStream os = Files.newOutputStream(this.cachedFile.toPath())) { - IOUtils.copy(originalResponse.getBody(), os); + InputStream body = originalResponse.getBody(); + LOGGER.debug("Get from input stream {}, for response {}", body.getClass(), originalResponse.getClass()); + LOGGER.debug("Body available: {}", body.available()); + IOUtils.copy(body, os); } } @@ -101,6 +105,7 @@ private CachedClientHttpResponse(final ClientHttpResponse originalResponse) thro @Nonnull public InputStream getBody() throws IOException { if (this.body == null) { + LOGGER.debug("Loading cached URI resource from {}", this.cachedFile); this.body = new FileInputStream(this.cachedFile); } return this.body;