aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/PersistentCacheProvider.java3
-rw-r--r--sonar-home/src/main/java/org/sonar/home/cache/PersistentCache.java9
2 files changed, 7 insertions, 5 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/PersistentCacheProvider.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/PersistentCacheProvider.java
index eca9407bce9..7ed124eafa0 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/PersistentCacheProvider.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/PersistentCacheProvider.java
@@ -19,6 +19,8 @@
*/
package org.sonar.batch.bootstrap;
+import org.sonar.home.log.Slf4jLog;
+
import org.sonar.home.cache.PersistentCacheBuilder;
import org.picocontainer.injectors.ProviderAdapter;
@@ -33,6 +35,7 @@ public class PersistentCacheProvider extends ProviderAdapter {
if (cache == null) {
PersistentCacheBuilder builder = new PersistentCacheBuilder();
+ builder.setLog(new Slf4jLog(PersistentCache.class));
String forceUpdate = props.property("sonar.forceUpdate");
if ("true".equals(forceUpdate)) {
diff --git a/sonar-home/src/main/java/org/sonar/home/cache/PersistentCache.java b/sonar-home/src/main/java/org/sonar/home/cache/PersistentCache.java
index f5493d3d6a0..a5d88ffcbe9 100644
--- a/sonar-home/src/main/java/org/sonar/home/cache/PersistentCache.java
+++ b/sonar-home/src/main/java/org/sonar/home/cache/PersistentCache.java
@@ -60,7 +60,7 @@ public class PersistentCache {
this.log = log;
this.forceUpdate = forceUpdate;
- log.info("cache: " + baseDir + " default expiration time (ms): " + defaultDurationToExpireMs);
+ log.info("cache: " + baseDir + ", default expiration time (ms): " + defaultDurationToExpireMs);
if (forceUpdate) {
log.debug("cache: forcing update");
@@ -104,20 +104,19 @@ public class PersistentCache {
@CheckForNull
public synchronized byte[] get(@Nonnull String obj, @Nullable Callable<byte[]> valueLoader) throws Exception {
String key = getKey(obj);
- log.debug("cache: " + obj + " -> " + key);
try (FileLock l = lock()) {
if (!forceUpdate) {
byte[] cached = getCache(key);
if (cached != null) {
- log.debug("cache hit for " + obj);
+ log.debug("cache hit for " + obj + " -> " + key);
return cached;
}
- log.debug("cache miss for " + obj);
+ log.debug("cache miss for " + obj + " -> " + key);
} else {
- log.debug("cache force update for " + obj);
+ log.debug("cache force update for " + obj + " -> " + key);
}
if (valueLoader != null) {