added more logs
This commit is contained in:
parent
3b208b450e
commit
a4611b887a
|
@ -1,17 +0,0 @@
|
|||
//package org.gcube.application.geoportal.service;
|
||||
//
|
||||
//import javax.ws.rs.ApplicationPath;
|
||||
//
|
||||
//import org.gcube.application.geoportal.service.rest.GeoportalHealth;
|
||||
//import org.glassfish.jersey.server.ResourceConfig;
|
||||
//
|
||||
//@ApplicationPath("/")
|
||||
//public class GeoPortalServiceHealth extends ResourceConfig {
|
||||
//
|
||||
// public GeoPortalServiceHealth() {
|
||||
//
|
||||
// registerClasses(GeoportalHealth.class);
|
||||
//
|
||||
// }
|
||||
//
|
||||
//}
|
|
@ -32,6 +32,7 @@ public class MongoHealthCheck implements HealthCheck {
|
|||
}
|
||||
|
||||
private HealthCheckResponse checkMongo(String context) {
|
||||
log.debug("checkMongo in the context: {}", context);
|
||||
HealthCheckResponseBuilder buildHCRBuilder = HealthCheckResponse.named(SERVICE_NAME);
|
||||
Mongo mongo = null;
|
||||
try {
|
||||
|
@ -39,6 +40,7 @@ public class MongoHealthCheck implements HealthCheck {
|
|||
mongo = ImplementationProvider.get().getProvidedObjectByClass(Mongo.class);
|
||||
buildHCRBuilder = appendMongoInfo(buildHCRBuilder, mongo.getConnection());
|
||||
buildHCRBuilder.state(true);
|
||||
log.info("checkMongo is OK in the context: {}", context);
|
||||
MongoIterable<String> collections = mongo.getTheClient().getDatabase(mongo.getConnection().getDatabase())
|
||||
.listCollectionNames();
|
||||
log.info("listCollectionNames is null: {}", collections == null);
|
||||
|
@ -50,6 +52,7 @@ public class MongoHealthCheck implements HealthCheck {
|
|||
}
|
||||
return buildHCRBuilder.build();
|
||||
} catch (Exception e) {
|
||||
log.info("checkMongo is KO in the context: {}", context);
|
||||
buildHCRBuilder.state(false);
|
||||
if (mongo != null) {
|
||||
MongoConnection connection = null;
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE xml>
|
||||
<application mode='online'>
|
||||
<name>${project.artifactId}</name>
|
||||
<group>${project.groupId}</group>
|
||||
<version>${project.version}</version>
|
||||
<description>${project.description}</description>
|
||||
<!-- <exclude>/srv/docs/*</exclude> -->
|
||||
<!-- <exclude>/srv/api-docs/*</exclude> -->
|
||||
<exclude>/src/health</exclude>
|
||||
</application>
|
||||
|
Loading…
Reference in New Issue