From 7f5e0fc426bf3ec60cd3a80708863f35b0e2de1c Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Wed, 18 Nov 2015 16:20:11 +0000 Subject: [PATCH] Added log to test on IS git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@120305 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../persistence/AccountingPersistenceBackendFactory.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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.