diff --git a/full/Changes b/full/Changes
index 198ab8c..e789a76 100644
--- a/full/Changes
+++ b/full/Changes
@@ -9,7 +9,9 @@
    - Handled storing cached VC with VC reference (margaretha)
 29/11/2018
    - Added a controller for listing user clients having active refresh tokens 
-     (margaretha)  
+     (margaretha)
+6/12/2018
+   - Added debug flags to mitigate log4j debugging performance (margaretha)
    
 # version 0.61.3
 17/10/2018
diff --git a/full/src/main/java/de/ids_mannheim/korap/annotation/FreeResourceParser.java b/full/src/main/java/de/ids_mannheim/korap/annotation/FreeResourceParser.java
index 1d7bc76..a06f738 100644
--- a/full/src/main/java/de/ids_mannheim/korap/annotation/FreeResourceParser.java
+++ b/full/src/main/java/de/ids_mannheim/korap/annotation/FreeResourceParser.java
@@ -37,7 +37,7 @@
         JsonNode node = mapper.readTree(is);
         for (JsonNode resource : node) {
             String resourceId = resource.at("/id").asText();
-            log.debug(resourceId);
+//            log.debug(resourceId);
             Set<AnnotationLayer> layers = parseLayers(resource.at("/layers"));
             try {
                 Resource r = resourceDao.retrieveResource(resourceId);
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/APIAuthentication.java b/full/src/main/java/de/ids_mannheim/korap/authentication/APIAuthentication.java
index 869b641..72378be 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/APIAuthentication.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/APIAuthentication.java
@@ -33,14 +33,14 @@
 public class APIAuthentication implements AuthenticationIface {
 
     private static Logger jlog = LogManager.getLogger(APIAuthentication.class);
-
+    public static boolean DEBUG = false;
+    
     private JWTSigner signedToken;
     private Cache invalided =
             CacheManager.getInstance().getCache("id_tokens_inv");
     // private Cache id_tokens =
     // CacheManager.getInstance().getCache("id_tokens");
 
-
     public APIAuthentication (FullConfiguration config) throws JOSEException {
         this.signedToken = new JWTSigner(config.getSharedSecret(),
                 config.getIssuer(), config.getTokenTTL());
@@ -82,7 +82,10 @@
         try {
             c.setExpirationTime(
                     jwt.getJWTClaimsSet().getExpirationTime().getTime());
-            jlog.debug(jwt.getJWTClaimsSet().getClaim(Attributes.AUTHENTICATION_TIME));
+            if (DEBUG ) {
+                jlog.debug(jwt.getJWTClaimsSet()
+                        .getClaim(Attributes.AUTHENTICATION_TIME));
+            }
             Date authTime = jwt.getJWTClaimsSet()
                     .getDateClaim(Attributes.AUTHENTICATION_TIME);
             ZonedDateTime time = ZonedDateTime.ofInstant(authTime.toInstant(),
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManager.java b/full/src/main/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManager.java
index e4e8ac1..e6bce21 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManager.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManager.java
@@ -61,6 +61,8 @@
 public class KustvaktAuthenticationManager extends AuthenticationManager {
 
 	private static Logger jlog = LogManager.getLogger(KustvaktAuthenticationManager.class);
+	public static boolean DEBUG = false;
+	
 	private EncryptionIface crypto;
 	private EntityHandlerIface entHandler;
 	@Autowired
@@ -232,7 +234,11 @@
 	    {
 	    	// to be absolutely sure:
 	    	user.setCorpusAccess(User.CorpusAccess.FREE);
-	    	jlog.debug("setAccessAndLocation: DemoUser: location="+user.locationtoString()+" access="+ user.accesstoString());
+            if (DEBUG) {
+                jlog.debug("setAccessAndLocation: DemoUser: location="
+                        + user.locationtoString() + " access="
+                        + user.accesstoString());
+            }
 	     	return;
 	    }
 		
@@ -251,11 +257,17 @@
 					corpusAccess = CorpusAccess.PUB;
 				}
 				
-			    jlog.debug(String.format("X-Forwarded-For : '%s' (%d values) -> %s\n", 
-						Arrays.toString(vals), vals.length, vals[0]));
-			    jlog.debug(String.format("X-Forwarded-For : location = %s corpusAccess = %s\n",
-						location == Location.INTERN ? "INTERN" : "EXTERN", corpusAccess == CorpusAccess.ALL ? "ALL"
-								: corpusAccess == CorpusAccess.PUB ? "PUB" : "FREE"));
+				if (DEBUG){
+                    jlog.debug(String.format(
+                            "X-Forwarded-For : '%s' (%d values) -> %s\n",
+                            Arrays.toString(vals), vals.length, vals[0]));
+                    jlog.debug(String.format(
+                            "X-Forwarded-For : location = %s corpusAccess = %s\n",
+                            location == Location.INTERN ? "INTERN" : "EXTERN",
+                            corpusAccess == CorpusAccess.ALL ? "ALL"
+                                    : corpusAccess == CorpusAccess.PUB ? "PUB"
+                                            : "FREE"));
+                }
 
 			} catch (UnknownHostException e) {
 				// TODO Auto-generated catch block
@@ -265,7 +277,11 @@
 			user.setLocation(location);
 			user.setCorpusAccess(corpusAccess);
 	    	
-	    	jlog.debug("setAccessAndLocation: KorAPUser: location="+user.locationtoString()+", access="+ user.accesstoString());
+            if (DEBUG) {
+                jlog.debug("setAccessAndLocation: KorAPUser: location="
+                        + user.locationtoString() + ", access="
+                        + user.accesstoString());
+            }
 
 		}
 	} // getAccess
@@ -345,8 +361,10 @@
 		}
 
 		boolean isAdmin = adminDao.isAdmin(unknown.getUsername());
-		jlog.debug("Authentication: found username " + unknown.getUsername());
-
+        if (DEBUG) {
+            jlog.debug(
+                    "Authentication: found username " + unknown.getUsername());
+        }
 		if (unknown instanceof KorAPUser) {
 			if (password == null || password.isEmpty())
 				throw new WrappedException(new KustvaktException(unknown.getId(), StatusCodes.BAD_CREDENTIALS),
@@ -370,7 +388,10 @@
 				URIParam param = (URIParam) user.getField(URIParam.class);
 
 				if (param.hasValues()) {
-					jlog.debug("Account is not yet activated for user '"+user.getUsername()+"'" );
+                    if (DEBUG) {
+                        jlog.debug("Account is not yet activated for user '"
+                                + user.getUsername() + "'");
+                    }
 					if (TimeUtils.getNow().isAfter(param.getUriExpiration())) {
 						jlog.error("URI token is expired. Deleting account for user "+ user.getUsername());
 						deleteAccount(user);
@@ -391,7 +412,9 @@
 		} else if (unknown instanceof ShibbolethUser) {
 			// todo
 		}
-		jlog.debug("Authentication done: "+unknown);
+        if (DEBUG) {
+            jlog.debug("Authentication done: " + unknown);
+        }
 		return unknown;
 	}
 
@@ -431,7 +454,9 @@
 		try {
 			// todo: unknown = ...
 			int ret = LdapAuth3.login(username, password, config.getLdapConfig());
-			System.out.printf("Debug: autenticationIdM: Ldap.login(%s) returns: %d.\n", username, ret);
+			if (DEBUG){
+			    jlog.debug("Debug: autenticationIdM: Ldap.login(%s) returns: %d.\n", username, ret);
+			}
 			if (ret != LdapAuth3.LDAP_AUTH_ROK) {
 				jlog.error("LdapAuth3.login(username='"+username+"') returns '"+ret+"'='"+LdapAuth3.getErrMessage(ret)+"'!");
 
@@ -474,8 +499,10 @@
 		 */
 		unknown = user;
 
-		jlog.trace("Authentication: found username " + unknown.getUsername());
-
+        if (DEBUG) {
+            jlog.trace(
+                    "Authentication: found username " + unknown.getUsername());
+        }
 		if (unknown instanceof KorAPUser) {
 			/*
 			 * password already checked using LDAP: if (password == null ||
@@ -523,7 +550,9 @@
 			// todo
 		}
 
-		jlog.debug("Authentication done: " + username);
+        if (DEBUG) {
+            jlog.debug("Authentication done: " + username);
+        }
 		return unknown;
 
 	} // authenticateIdM
@@ -752,7 +781,10 @@
 
 	// todo:
 	private ShibbolethUser createShibbUserAccount(Map<String, Object> attributes) throws KustvaktException {
-		jlog.debug("creating shibboleth user account for user attr: "+ attributes);
+        if (DEBUG) {
+            jlog.debug("creating shibboleth user account for user attr: "
+                    + attributes);
+        }
 		Map<String, Object> safeMap = validator.validateMap(attributes);
 
 		// todo eppn non-unique.join with idp or use persistent_id as username
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/LoginCounter.java b/full/src/main/java/de/ids_mannheim/korap/authentication/LoginCounter.java
index 7da50b6..aeb2856 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/LoginCounter.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/LoginCounter.java
@@ -20,9 +20,12 @@
     private final Map<String, Long[]> failedLogins;
     private KustvaktConfiguration config;
 
+    public static boolean DEBUG = false;
 
     public LoginCounter (KustvaktConfiguration config) {
-        jlog.debug("init login counter for authentication management");
+        if (DEBUG) {
+            jlog.debug("init login counter for authentication management");
+        }
         this.config = config;
         this.failedLogins = new HashMap<>();
     }
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/SessionAuthentication.java b/full/src/main/java/de/ids_mannheim/korap/authentication/SessionAuthentication.java
index af8e953..e59d21f 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/SessionAuthentication.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/SessionAuthentication.java
@@ -29,6 +29,8 @@
 
     private static final Logger jlog = LogManager
             .getLogger(SessionAuthentication.class);
+    public static boolean DEBUG = false;
+    
     public static SessionFactory sessions;
     private ScheduledThreadPoolExecutor scheduled;
     private EncryptionIface crypto;
@@ -52,7 +54,10 @@
     @Override
     public TokenContext getTokenContext(String authenticationToken)
             throws KustvaktException {
-        jlog.debug("retrieving user session for user "+ authenticationToken);
+        if (DEBUG) {
+            jlog.debug(
+                    "retrieving user session for user " + authenticationToken);
+        }
         return this.sessions.getSession(authenticationToken);
     }
 
@@ -72,10 +77,12 @@
         ctx.setExpirationTime(ex.getMillis()+(1000));
         ctx.setHostAddress(attr.get(Attributes.HOST).toString());
         ctx.setUserAgent(attr.get(Attributes.USER_AGENT).toString());
-        jlog.debug(ctx.toJson());
         this.sessions.putSession(token, ctx);
-        jlog.debug("session " +sessions.getSession(token).toString());
-        jlog.info("create session for user: " + user.getUsername());
+        if (DEBUG) {
+            jlog.debug(ctx.toJson());
+            jlog.debug("session " +sessions.getSession(token).toString());
+            jlog.info("create session for user: " + user.getUsername());
+        }
         return ctx;
     }
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/SessionFactory.java b/full/src/main/java/de/ids_mannheim/korap/authentication/SessionFactory.java
index 6d425c2..62c7442 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/SessionFactory.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/SessionFactory.java
@@ -33,6 +33,7 @@
 public class SessionFactory implements Runnable {
 
     private static Logger jlog = LogManager.getLogger(SessionFactory.class);
+    public static boolean DEBUG = false;
 
     public static ConcurrentMap<String, TokenContext> sessionsObject;
     public static ConcurrentMap<String, DateTime> timeCheck;
@@ -43,7 +44,9 @@
 
 
     public SessionFactory (boolean multipleEnabled, int inactive) {
-        jlog.debug("allow multiple sessions per user: "+ multipleEnabled);
+        if (DEBUG) {
+            jlog.debug("allow multiple sessions per user: " + multipleEnabled);
+        }
         this.multipleEnabled = multipleEnabled;
         this.inactive = inactive;
         this.sessionsObject = new ConcurrentHashMap<>();
@@ -63,7 +66,9 @@
     // todo: remove this!
     @Cacheable("session")
     public TokenContext getSession (String token) throws KustvaktException {
-        jlog.debug("logged in users: "+ loggedInRecord);
+        if (DEBUG) {
+            jlog.debug("logged in users: " + loggedInRecord);
+        }
         TokenContext context = sessionsObject.get(token);
         if (context != null) {
             // fixme: set context to respecitve expiratin interval and return context. handler checks expiration later!
@@ -134,11 +139,12 @@
         if (timeCheck.containsKey(token)) {
             if (TimeUtils.plusSeconds(timeCheck.get(token).getMillis(),
                     inactive).isAfterNow()) {
-                jlog.debug("user has session");
+                if (DEBUG){ jlog.debug("user has session");}
                 return true;
             }
-            else
+            else if (DEBUG){
                 jlog.debug("user with token "+token+" has an invalid session");
+            }
         }
         return false;
     }
@@ -161,9 +167,12 @@
             }
         }
         // fixme: not doing anything!
-        if (inactive.size() > 0)
+        if (inactive.size() > 0){
+            if (DEBUG){
             jlog.trace("removing inactive user session for users "+
                     inactive);
+            }
+        }
     }
 
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/config/JWTSigner.java b/full/src/main/java/de/ids_mannheim/korap/config/JWTSigner.java
index dee393f..21f3921 100644
--- a/full/src/main/java/de/ids_mannheim/korap/config/JWTSigner.java
+++ b/full/src/main/java/de/ids_mannheim/korap/config/JWTSigner.java
@@ -39,6 +39,7 @@
 public class JWTSigner {
 
     private static Logger jlog = LogManager.getLogger(JWTSigner.class);
+    public static boolean DEBUG = false;
     
     private URL issuer;
     private JWSSigner signer;
@@ -92,7 +93,7 @@
                 attr.get(Attributes.AUTHENTICATION_TIME));
         
         JWTClaimsSet jwtClaimsSet = csBuilder.build();
-        jlog.debug(jwtClaimsSet.getClaim(Attributes.AUTHENTICATION_TIME));
+        if (DEBUG) jlog.debug(jwtClaimsSet.getClaim(Attributes.AUTHENTICATION_TIME));
         SignedJWT signedJWT =
                 new SignedJWT(new JWSHeader(JWSAlgorithm.HS256), jwtClaimsSet);
         try {
diff --git a/full/src/main/java/de/ids_mannheim/korap/config/NamedVCLoader.java b/full/src/main/java/de/ids_mannheim/korap/config/NamedVCLoader.java
index 2b72e84..f1242e5 100644
--- a/full/src/main/java/de/ids_mannheim/korap/config/NamedVCLoader.java
+++ b/full/src/main/java/de/ids_mannheim/korap/config/NamedVCLoader.java
@@ -31,7 +31,8 @@
     @Autowired
     private VirtualCorpusService vcService;
 
-    private static Logger jlog = LogManager.getLogger(NamedVCLoader.class);
+    public static Logger jlog = LogManager.getLogger(NamedVCLoader.class);
+    public static boolean DEBUG = false;
 
     public void loadVCToCache (String filename, String filePath)
             throws IOException, QueryException, KustvaktException {
@@ -71,7 +72,9 @@
                     VirtualCorpus vc = vcService.searchVCByName("system",
                             filename, "system");
                     if (vc != null) {
-                        jlog.debug("Delete existing vc: " + filename);
+                        if (DEBUG) {
+                            jlog.debug("Delete existing vc: " + filename);
+                        }
                         vcService.deleteVC("system", vc.getId());
                     }
                 }
@@ -106,7 +109,9 @@
                     + " is not allowed. Filename must ends with .jsonld or .jsonld.gz");
         }
         long end = System.currentTimeMillis();
-        jlog.debug("READ " + filename + " duration: " + (end - start));
+        if (DEBUG) {
+            jlog.debug("READ " + filename + " duration: " + (end - start));
+        }
 
         return new String[] { filename, json };
     }
@@ -118,18 +123,18 @@
         start = System.currentTimeMillis();
 
         KrillCollection collection = new KrillCollection(json);
-        jlog.debug("Finished creating KrillCollection");
-        jlog.debug("Set Index to collection");
         collection.setIndex(searchKrill.getIndex());
 
-        jlog.debug("StoreInCache " + filename);
+        jlog.info("Store vc in cache " + filename);
         if (collection != null) {
             collection.storeInCache(filename);
         }
         end = System.currentTimeMillis();
         jlog.info(filename + " caching duration: " + (end - start));
-        jlog.debug("memory cache: "
-                + KrillCollection.cache.calculateInMemorySize());
+        if (DEBUG) {
+            jlog.debug("memory cache: "
+                    + KrillCollection.cache.calculateInMemorySize());
+        }
     }
 
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2AuthorizationService.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2AuthorizationService.java
index 227cf0e..4fab78a 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2AuthorizationService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2AuthorizationService.java
@@ -22,9 +22,11 @@
 @Service(value = "authorizationService")
 public class OAuth2AuthorizationService {
 
-    private static Logger jlog =
+    public static Logger jlog =
             LogManager.getLogger(OAuth2AuthorizationService.class);
 
+    public static boolean DEBUG = false;
+    
     @Autowired
     protected OAuth2ClientService clientService;
     @Autowired
@@ -179,9 +181,10 @@
     private boolean isExpired (ZonedDateTime expiryDate) {
         ZonedDateTime now =
                 ZonedDateTime.now(ZoneId.of(Attributes.DEFAULT_TIME_ZONE));
-        jlog.debug("createdDate: " + expiryDate);
-        jlog.debug("expiration: " + expiryDate + ", now: " + now);
-
+        if (DEBUG) {
+            jlog.debug("createdDate: " + expiryDate);
+            jlog.debug("expiration: " + expiryDate + ", now: " + now);
+        }
         if (expiryDate.isAfter(now)) {
             return false;
         }
diff --git a/full/src/main/java/de/ids_mannheim/korap/service/MailService.java b/full/src/main/java/de/ids_mannheim/korap/service/MailService.java
index 13a6969..1aaebc5 100644
--- a/full/src/main/java/de/ids_mannheim/korap/service/MailService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/service/MailService.java
@@ -33,8 +33,9 @@
 @Service
 public class MailService {
 
-    private static Logger jlog = LogManager.getLogger(MailService.class);
-
+    public static Logger jlog = LogManager.getLogger(MailService.class);
+    public static boolean DEBUG = false;
+    
     @Autowired
     private AuthenticationManager authenticationManager;
     @Autowired
@@ -84,7 +85,7 @@
                 StandardCharsets.UTF_8.name(), context, stringWriter);
 
         String message = stringWriter.toString();
-        jlog.debug(message);
+        if (DEBUG) jlog.debug(message);
         return message;
     }
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/service/ResourceService.java b/full/src/main/java/de/ids_mannheim/korap/service/ResourceService.java
index ed68fc9..373f42f 100644
--- a/full/src/main/java/de/ids_mannheim/korap/service/ResourceService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/service/ResourceService.java
@@ -21,7 +21,8 @@
 @Service
 public class ResourceService {
 
-    private static Logger jlog = LogManager.getLogger(ResourceService.class);
+    public static Logger jlog = LogManager.getLogger(ResourceService.class);
+    public static boolean DEBUG = false;
 
     @Autowired
     private ResourceDao resourceDao;
@@ -32,7 +33,9 @@
         List<Resource> resources = resourceDao.getAllResources();
         List<ResourceDto> resourceDtos =
                 resourceConverter.convertToResourcesDto(resources);
-        jlog.debug("/info " + resourceDtos.toString());
+        if (DEBUG) {
+            jlog.debug("/info " + resourceDtos.toString());
+        }
         return resourceDtos;
     }
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/service/UserGroupService.java b/full/src/main/java/de/ids_mannheim/korap/service/UserGroupService.java
index 9133169..b45114d 100644
--- a/full/src/main/java/de/ids_mannheim/korap/service/UserGroupService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/service/UserGroupService.java
@@ -44,7 +44,9 @@
 @Service
 public class UserGroupService {
 
-    private static Logger jlog = LogManager.getLogger(UserGroupService.class);
+    public static Logger jlog = LogManager.getLogger(UserGroupService.class);
+    public static boolean DEBUG = false;
+    
     @Autowired
     private UserGroupDao userGroupDao;
     @Autowired
@@ -412,10 +414,14 @@
         }
         // status pending
         else {
-            jlog.debug("status: " + member.getStatusDate());
+            if (DEBUG) {
+                jlog.debug("status: " + member.getStatusDate());
+            }
             ZonedDateTime expiration = member.getStatusDate().plusMinutes(30);
             ZonedDateTime now = ZonedDateTime.now();
-            jlog.debug("expiration: " + expiration + ", now: " + now);
+            if (DEBUG) {
+                jlog.debug("expiration: " + expiration + ", now: " + now);
+            }
 
             if (expiration.isAfter(now)) {
                 member.setStatus(GroupMemberStatus.ACTIVE);
diff --git a/full/src/main/java/de/ids_mannheim/korap/service/VirtualCorpusService.java b/full/src/main/java/de/ids_mannheim/korap/service/VirtualCorpusService.java
index 790e520..c4f2241 100644
--- a/full/src/main/java/de/ids_mannheim/korap/service/VirtualCorpusService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/service/VirtualCorpusService.java
@@ -53,9 +53,11 @@
 @Service
 public class VirtualCorpusService {
 
-    private static Logger jlog =
+    public static Logger jlog =
             LogManager.getLogger(VirtualCorpusService.class);
 
+    public static boolean DEBUG = false;
+    
     public static Pattern wordPattern = Pattern.compile("[-\\w. ]+");
 
     @Autowired
@@ -262,13 +264,16 @@
             KoralCollectionQueryBuilder koral = new KoralCollectionQueryBuilder();
             koral.with("referTo "+name);
             String vcRef = koral.toJSON();
-            jlog.debug("Determine vc access with vc ref: " + vcRef);
+            if (DEBUG) {
+                jlog.debug("Determine vc access with vc ref: " + vcRef);
+            }
             requiredAccess = determineRequiredAccess(vcRef);
         }
         else{
             requiredAccess = determineRequiredAccess(koralQuery);
         }
-        jlog.debug("Storing VC "+name);
+        
+        if (DEBUG) jlog.debug("Storing VC "+name+"in the database ");
         int vcId = 0;
         try {
             vcId = vcDao.createVirtualCorpus(name, type, requiredAccess,
@@ -308,7 +313,9 @@
             throw new KustvaktException(StatusCodes.INVALID_ARGUMENT,
                     "Invalid argument: " + corpusQuery, corpusQuery);
         }
-        jlog.debug(koralQuery);
+        if (DEBUG) {
+            jlog.debug(koralQuery);
+        }
         return koralQuery;
     }
 
@@ -336,7 +343,10 @@
         String statistics = krill.getStatistics(json);
         JsonNode node = JsonUtils.readTree(statistics);
         int numberOfDoc = node.at("/documents").asInt();
-        jlog.debug("License: " + license + ", number of docs: " + numberOfDoc);
+        if (DEBUG) {
+            jlog.debug(
+                    "License: " + license + ", number of docs: " + numberOfDoc);
+        }
         return (numberOfDoc > 0) ? true : false;
     }
 
