diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/index/BundleContextInterceptor.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/index/BundleContextInterceptor.java
index 62dc4e2..9224898 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/index/BundleContextInterceptor.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/index/BundleContextInterceptor.java
@@ -21,7 +21,6 @@
 import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
-import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.felix.dm.FilterIndex;
 import org.apache.felix.dm.impl.Logger;
@@ -36,16 +35,19 @@
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public class BundleContextInterceptor extends BundleContextInterceptorBase {
-	private static final String INDEX_LOG_BAD_PERFORMING_FILTERS = "org.apache.felix.dependencymanager.index.logbadperformingfilters";
-	private static long maxLookupTime = 0L;
+	protected static final String INDEX_LOG_TRESHOLD = "org.apache.felix.dm.index.log.treshold";
     private final ServiceRegistryCache m_cache;
-    private final boolean perfmon = "true".equals(System.getProperty(INDEX_LOG_BAD_PERFORMING_FILTERS));
-	private final Logger m_logger;
+    private final boolean m_perfmon = System.getProperty(INDEX_LOG_TRESHOLD) != null;
+	private Logger m_logger;
+	private long m_treshold;
 
-    public BundleContextInterceptor(ServiceRegistryCache cache, BundleContext context, Logger logger) {
+    public BundleContextInterceptor(ServiceRegistryCache cache, BundleContext context) {
         super(context);
         m_cache = cache;
-		m_logger = logger;
+		if (m_perfmon) {
+			m_treshold = Long.parseLong(System.getProperty(INDEX_LOG_TRESHOLD));
+			m_logger = new Logger(context);
+		}
     }
 
     public void addServiceListener(ServiceListener listener, String filter) throws InvalidSyntaxException {
@@ -82,7 +84,7 @@
 
     public ServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException {
     	long start = 0L;
-    	if (perfmon) {
+    	if (m_perfmon) {
     		start = System.currentTimeMillis();
     	}
         // first we ask the cache if there is an index for our request (class and filter combination)
@@ -100,11 +102,10 @@
                     }
                 }
             }
-            if (perfmon) {
+            if (m_perfmon) {
 	        	long duration = System.currentTimeMillis() - start;
-	        	if (maxLookupTime < duration) {
-	        		maxLookupTime = duration;
-	        		m_logger.log(org.apache.felix.dm.impl.Logger.LOG_DEBUG, "new worst performing filter (" + duration + "ms.): " + clazz + " " + filter);
+	        	if (duration > m_treshold) {
+	        		m_logger.log(org.apache.felix.dm.impl.Logger.LOG_DEBUG, "Indexed filter exceeds lookup time treshold (" + duration + "ms.): " + clazz + " " + filter);
 	        	}
             }
             if (result == null || result.size() == 0) {
@@ -115,11 +116,10 @@
         else {
             // if they don't know, we ask the real bundle context instead
             ServiceReference[] serviceReferences = m_context.getServiceReferences(clazz, filter);
-            if (perfmon) {
+            if (m_perfmon) {
 	        	long duration = System.currentTimeMillis() - start;
-	        	if (maxLookupTime < duration) {
-	        		maxLookupTime = duration;
-	        		System.out.println("new worst performing filter (" + duration + "ms.): " + clazz + " " + filter);
+	        	if (duration > m_treshold) {
+	        		m_logger.log(org.apache.felix.dm.impl.Logger.LOG_DEBUG, "Unindexed filter exceeds lookup time treshold (" + duration + "ms.): " + clazz + " " + filter);
 	        	}
             }
         	return serviceReferences;
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/index/ServiceRegistryCache.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/index/ServiceRegistryCache.java
index bbb0995..f97637c 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/index/ServiceRegistryCache.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/index/ServiceRegistryCache.java
@@ -36,7 +36,6 @@
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public class ServiceRegistryCache implements ServiceListener/*, CommandProvider*/ {
-    private static final String INDEX_PERFLOG = "org.apache.felix.dependencymanager.index.logmissingindices";
 	private final List /* <FilterIndex> */ m_filterIndexList = new CopyOnWriteArrayList();
     private final BundleContext m_context;
     private final FilterIndexBundleContext m_filterIndexBundleContext;
@@ -45,16 +44,9 @@
     private long m_arrayVersion = -1;
     private BundleContextInterceptor[] m_interceptors = null;
     private ServiceRegistration m_registration;
-    private boolean m_dumpUnIndexedFilters = "true".equals(System.getProperty(INDEX_PERFLOG));
-    private List m_unindexedFilters = new ArrayList();
-	private Logger m_logger;
     
     public ServiceRegistryCache(BundleContext context) {
         m_context = context;
-        // only obtain the logservice when we actually want to log something.
-        if (System.getProperty(INDEX_PERFLOG) != null) {
-        	m_logger = new Logger(context);
-        }
         m_filterIndexBundleContext = new FilterIndexBundleContext(m_context);
     }
     
@@ -98,7 +90,7 @@
         synchronized (m_bundleContextInterceptorMap) {
             BundleContextInterceptor bundleContextInterceptor = (BundleContextInterceptor) m_bundleContextInterceptorMap.get(context);
             if (bundleContextInterceptor == null) {
-                bundleContextInterceptor = new BundleContextInterceptor(this, context, m_logger);
+                bundleContextInterceptor = new BundleContextInterceptor(this, context);
                 m_bundleContextInterceptorMap.put(context, bundleContextInterceptor);
                 m_currentVersion++;
                 // TODO figure out a good way to clean up bundle contexts that are no longer valid so they can be garbage collected
@@ -115,13 +107,6 @@
                 return filterIndex;
             }
         }
-        if (m_dumpUnIndexedFilters) {
-        	String filterStr = clazz + ":" + filter;
-	        if (!m_unindexedFilters.contains(filterStr)) {
-	        	m_unindexedFilters.add(filterStr);
-	        	m_logger.log(Logger.LOG_DEBUG, "No filter index for " + filterStr);
-	        }
-        }
         return null;
     }
 
