Commit 45d632da authored by Labros Papadopoulos's avatar Labros Papadopoulos
Browse files

fix: optimize logging

parent 0ae08c17
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ public class OssRestClientImpl {
                                                logger.debugf("Closing REST client for URL: %s due to %s", key, cause);
                                                ((Closeable) client).close();
                                            } catch (IOException e) {
                                                logger.warn("Failed to close REST client for " + key, e);
                                                logger.debugf("Failed to close REST client for " + key, e);
                                            }
                                        }
                                    })
@@ -151,7 +151,7 @@ public class OssRestClientImpl {
        try {
            return action.apply(client, tokens);
        } catch (Exception e) {
            logger.warnf(
            logger.debugf(
                    "Request failed for %s, attempting to refresh token and retry: " + e.getMessage(), name);

            // Force refresh token
+5 −2
Original line number Diff line number Diff line
@@ -162,13 +162,16 @@ public class HealthCheckService {
            return; // Don't try to write to DB/Kafka if they are already down!
        }

        logger.warnf(
        logger.debugf(
                "Health check failed for org %s: %s", ossClientDatum.getOrganizationId(), e.getMessage());

        int newCounter = ossClientDatum.getHealthCheckCounter() + 1;

        if (newCounter > failedAttempts) {
            logger.errorf(MAXIMUM_HEARTBEAT_ATTEMPTS + " %s", ossClientDatum.getOrganizationId());
            logger.errorf(
                    MAXIMUM_HEARTBEAT_ATTEMPTS + " with name %s and id %s",
                    ossClientDatum.getName(),
                    ossClientDatum.getOrganizationId());
            try {
                peeringProducer.sendHeartbeatFailure(ossClientDatum.getOrganizationId());
            } catch (Exception kafkaEx) {
+1 −1
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ public class PeeringService {
                parseRetrievedSpecifications(peeredSpecifications, ossLifecycleData);
        peeredOrganizationData.setServiceCatalogs(serviceCatalogs);
        sendUpdateMessage(peeredOrganizationData);
        logger.infof(
        logger.debugf(
                "Updated Service specifications of peered organization %s has been sent to tmf api via kafka topic %s",
                peeredOrganizationData.getOrganizationId(), "updated-service-specs");
        peeredSpecifications.forEach(