From b6e9fcddaec888b9f8b46ec2a342d789ea303808 Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Thu, 17 Oct 2024 11:18:03 +0200 Subject: [PATCH] added some logs --- .../geoportal/service/rest/GeoportalHealthCheck.java | 2 ++ .../rest/check/HealthCheckResponseGeoportalProvider.java | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/geoportal-service/src/main/java/org/gcube/application/geoportal/service/rest/GeoportalHealthCheck.java b/geoportal-service/src/main/java/org/gcube/application/geoportal/service/rest/GeoportalHealthCheck.java index 2f4e404..5343a76 100644 --- a/geoportal-service/src/main/java/org/gcube/application/geoportal/service/rest/GeoportalHealthCheck.java +++ b/geoportal-service/src/main/java/org/gcube/application/geoportal/service/rest/GeoportalHealthCheck.java @@ -65,8 +65,10 @@ public class GeoportalHealthCheck implements HealthCheck { buildHCRProvider.setStatus(Status.UP); MongoIterable collections = mongo.getTheClient().getDatabase(mongo.getConnection().getDatabase()) .listCollectionNames(); + log.info("listCollectionNames is null: {}", collections == null); int i = 1; for (String coll : collections) { + log.info("adding collection: {}", coll); buildHCRProvider.withData("collection " + i, coll); i++; } diff --git a/geoportal-service/src/main/java/org/gcube/application/geoportal/service/rest/check/HealthCheckResponseGeoportalProvider.java b/geoportal-service/src/main/java/org/gcube/application/geoportal/service/rest/check/HealthCheckResponseGeoportalProvider.java index e85b981..7ec1ac5 100644 --- a/geoportal-service/src/main/java/org/gcube/application/geoportal/service/rest/check/HealthCheckResponseGeoportalProvider.java +++ b/geoportal-service/src/main/java/org/gcube/application/geoportal/service/rest/check/HealthCheckResponseGeoportalProvider.java @@ -7,6 +7,8 @@ import java.util.Optional; import org.eclipse.microprofile.health.HealthCheckResponse; import org.eclipse.microprofile.health.HealthCheckResponse.Status; +import lombok.extern.slf4j.Slf4j; + /** * The Class HealthCheckResponseGeoportalProvider. * @@ -14,6 +16,7 @@ import org.eclipse.microprofile.health.HealthCheckResponse.Status; * * Oct 16, 2024 */ +@Slf4j public class HealthCheckResponseGeoportalProvider { private String name; @@ -108,6 +111,9 @@ public class HealthCheckResponseGeoportalProvider { public HealthCheckResponse buildHealthCheckResponse() { if (myMap != null) data = Optional.of(myMap); + + log.info("data are: "+data); + return new HealthCheckResponse(name, status, data); }