diff --git a/src/main/java/org/gcube/accounting/persistence/AccountingPersistenceBackendFactory.java b/src/main/java/org/gcube/accounting/persistence/AccountingPersistenceBackendFactory.java index 728393f..611ae9b 100644 --- a/src/main/java/org/gcube/accounting/persistence/AccountingPersistenceBackendFactory.java +++ b/src/main/java/org/gcube/accounting/persistence/AccountingPersistenceBackendFactory.java @@ -69,6 +69,7 @@ public abstract class AccountingPersistenceBackendFactory { } protected static FallbackPersistenceBackend createFallback(String scope){ + logger.debug("Creating {} for scope {}", FallbackPersistenceBackend.class.getSimpleName(), scope); File fallbackFile = null; if(scope!=null){ ScopeBean bean = new ScopeBean(scope); @@ -84,6 +85,8 @@ public abstract class AccountingPersistenceBackendFactory { } protected static AccountingPersistenceBackend discoverAccountingPersistenceBackend(String scope){ + logger.debug("Discovering {} for scope {}", + AccountingPersistenceBackend.class.getSimpleName(), scope); ServiceLoader serviceLoader = ServiceLoader.load(AccountingPersistenceBackend.class); for (AccountingPersistenceBackend foundPersistence : serviceLoader) { try { @@ -111,7 +114,7 @@ public abstract class AccountingPersistenceBackendFactory { protected static AccountingPersistenceBackend rediscoverAccountingPersistenceBackend(AccountingPersistenceBackend actual, String scope){ Long now = Calendar.getInstance().getTimeInMillis(); Long lastCheckTimestamp = fallbackLastCheck.get(scope); - logger.trace("Last check was {}", lastCheckTimestamp); + logger.debug("Last check for scope {} was {}", scope, lastCheckTimestamp); if( (lastCheckTimestamp + FALLBACK_RETRY_TIME) <= now ){ logger.debug("The {} for scope {} is {}. Is time to rediscover if there is another possibility.", @@ -178,8 +181,10 @@ public abstract class AccountingPersistenceBackendFactory { } AccountingPersistenceBackend persistence = null; + logger.debug("Going to synchronized block in getPersistenceBackend"); synchronized (accountingPersistenceBackends) { persistence = accountingPersistenceBackends.get(scope); + logger.debug("{} {}", AccountingPersistenceBackend.class.getSimpleName(), persistence); if(persistence==null){ /* * Setting FallbackPersistence and unlocking.