diff --git a/pom.xml b/pom.xml
index b8534ce..52043a2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -96,7 +96,6 @@
                 <directory>src/test/resources</directory>
                 <filtering>true</filtering>
                 <includes>
-
                     <include>**/*.prop</include>
                     <include>**/*.xml</include>
                     <include>**/*.conf</include>
@@ -107,11 +106,11 @@
                 <directory>src/main/resources</directory>
                 <filtering>true</filtering>
                 <includes>
-                    <include>**/*.prop</include>
-                    <include>**/*.xml</include>
-                    <include>**/*.conf</include>
+                    <!--<include>**/*.prop</include>-->
+                    <!--<include>**/*.xml</include>-->
+                    <!--<include>**/*.conf</include>-->
                     <include>**/*.properties</include>
-                    <include>**/*.sql</include>
+                    <!--<include>**/*.sql</include>-->
                 </includes>
             </testResource>
         </testResources>
diff --git a/src/main/java/de/ids_mannheim/korap/config/JWTSigner.java b/src/main/java/de/ids_mannheim/korap/config/JWTSigner.java
index aa1e00b..6563563 100644
--- a/src/main/java/de/ids_mannheim/korap/config/JWTSigner.java
+++ b/src/main/java/de/ids_mannheim/korap/config/JWTSigner.java
@@ -117,7 +117,7 @@
         return signContent(username, "", "", ttl);
     }
 
-    private SignedJWT verifyToken(String token) throws KustvaktException {
+    public SignedJWT verifyToken(String token) throws KustvaktException {
         SignedJWT client;
         try {
             client = SignedJWT.parse(token);
diff --git a/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java b/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
index 406d319..9f1bdee 100644
--- a/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
+++ b/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
@@ -92,6 +92,7 @@
      */
     protected Properties load(Properties properties)
             throws MalformedURLException {
+        properties.list(System.out);
         maxhits = new Integer(properties.getProperty("maxhits", "50000"));
         returnhits = new Integer(properties.getProperty("returnhits", "50000"));
         indexDir = properties.getProperty("lucene.indexDir", "");
diff --git a/src/main/java/de/ids_mannheim/korap/security/ac/PolicyDao.java b/src/main/java/de/ids_mannheim/korap/security/ac/PolicyDao.java
index 33dc18d..ec611e7 100644
--- a/src/main/java/de/ids_mannheim/korap/security/ac/PolicyDao.java
+++ b/src/main/java/de/ids_mannheim/korap/security/ac/PolicyDao.java
@@ -16,6 +16,7 @@
 import de.ids_mannheim.korap.utils.KustvaktLogger;
 import de.ids_mannheim.korap.utils.StringUtils;
 import de.ids_mannheim.korap.utils.TimeUtils;
+import org.slf4j.Logger;
 import org.springframework.dao.DataAccessException;
 import org.springframework.jdbc.core.ResultSetExtractor;
 import org.springframework.jdbc.core.RowCallbackHandler;
@@ -37,6 +38,9 @@
 // todo: transactions and exception management
 public class PolicyDao implements PolicyHandlerIface {
 
+    private static final Logger jlog = KustvaktLogger
+            .getLogger(PolicyDao.class);
+
     private NamedParameterJdbcTemplate jdbcTemplate;
 
     public PolicyDao(PersistenceClient client) {
@@ -90,9 +94,8 @@
             this.mapConstraints(policy);
             return policy.getID();
         }catch (DataAccessException e) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("Operation (INSERT) not possible for '{}' for user '{}'",
-                            policy.toString(), user.getId());
+            jlog.error("Operation (INSERT) not possible for '{}' for user '{}'",
+                    policy.toString(), user.getId());
             throw new dbException(user.getId(), "policy_store",
                     StatusCodes.DB_INSERT_FAILED, policy.toString());
         }
@@ -141,9 +144,9 @@
             }
             policy.clear();
         }catch (DataAccessException e) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("Operation (MAPPING POLICY CONDITIONS) not possible for '{}' for user '{}'",
-                            policy.toString(), policy.getCreator());
+            jlog.error(
+                    "Operation (MAPPING POLICY CONDITIONS) not possible for '{}' for user '{}'",
+                    policy.toString(), policy.getCreator());
             // throwing an error here is not recommended
             //            throw new dbException(policy.getCreator(), "policy_store",
             //                    StatusCodes.DB_INSERT_FAILED, policy.toString());
@@ -181,9 +184,9 @@
                     this.addToCondition(Arrays.asList(user.getUsername()), cond,
                             admin);
             }catch (DataAccessException e) {
-                KustvaktLogger.SECURITY_LOGGER
-                        .error("Operation (SELECT) not possible for '{}' for user '{}'",
-                                policy.getTarget(), user.getId());
+                jlog.error(
+                        "Operation (SELECT) not possible for '{}' for user '{}'",
+                        policy.getTarget(), user.getId());
                 throw new dbException(user.getId(), "policy_store",
                         StatusCodes.DB_GET_FAILED, policy.toString());
             }
@@ -228,9 +231,9 @@
                         }
                     });
         }catch (DataAccessException e) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("Permission Denied for policy retrieval for '{}' for user '{}'",
-                            target, user.getId());
+            jlog.error(
+                    "Permission Denied for policy retrieval for '{}' for user '{}'",
+                    target, user.getId());
             return new List[2];
         }
     }
@@ -273,9 +276,9 @@
                         }
                     });
         }catch (DataAccessException e) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("Permission Denied for policy retrieval for '{}' for user '{}'",
-                            target, user.getId());
+            jlog.error(
+                    "Permission Denied for policy retrieval for '{}' for user '{}'",
+                    target, user.getId());
             return new List[2];
         }
     }
@@ -316,9 +319,9 @@
                         }
                     });
         }catch (DataAccessException e) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("Permission Denied for retrieval for resource id '{}' for user '{}'",
-                            path, user.getId());
+            jlog.error(
+                    "Permission Denied for retrieval for resource id '{}' for user '{}'",
+                    path, user.getId());
             return new List[2];
         }
     }
@@ -396,9 +399,9 @@
             return this.jdbcTemplate.query(sql, param,
                     new SecurityRowMappers.HierarchicalResultExtractor());
         }catch (DataAccessException e) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("Permission Denied for retrieval for path '{}' for user '{}'",
-                            path, user.getId());
+            jlog.error(
+                    "Permission Denied for retrieval for path '{}' for user '{}'",
+                    path, user.getId());
             throw new dbException(user.getId(), "policy_store",
                     StatusCodes.DB_GET_FAILED, path, clazz.toString());
         }
@@ -470,9 +473,9 @@
             return this.jdbcTemplate.query(sql, param,
                     new SecurityRowMappers.HierarchicalResultExtractor());
         }catch (DataAccessException e) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("Permission Denied for retrieval for path '{}' for user '{}'",
-                            name, user.getId());
+            jlog.error(
+                    "Permission Denied for retrieval for path '{}' for user '{}'",
+                    name, user.getId());
             throw new dbException(user.getId(), "policy_store",
                     StatusCodes.DB_GET_FAILED, name, clazz.toString());
         }
@@ -495,9 +498,8 @@
             return this.jdbcTemplate
                     .update("DELETE FROM policy_store WHERE id=:id", param);
         }catch (DataAccessException e) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("Operation (DELETE) not possible for '{}' for user '{}'",
-                            policy.toString(), user.getId());
+            jlog.error("Operation (DELETE) not possible for '{}' for user '{}'",
+                    policy.toString(), user.getId());
             throw new dbException(user.getId(), "policy_store, group_ref",
                     StatusCodes.DB_DELETE_FAILED, policy.toString());
         }
@@ -512,9 +514,8 @@
         try {
             this.jdbcTemplate.update(sql, param);
         }catch (DataAccessException e) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("Operation (DELETE) not possible for '{}' for user '{}'",
-                            id, user.getId());
+            jlog.error("Operation (DELETE) not possible for '{}' for user '{}'",
+                    id, user.getId());
             throw new dbException(user.getId(), "policy_store",
                     StatusCodes.DB_DELETE_FAILED, id);
         }
@@ -536,9 +537,8 @@
             this.mapConstraints(policy);
             return result;
         }catch (DataAccessException e) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("Operation (UPDATE) not possible for '{}' for user '{}'",
-                            policy.toString(), user.getId());
+            jlog.error("Operation (UPDATE) not possible for '{}' for user '{}'",
+                    policy.toString(), user.getId());
             throw new dbException(user.getId(), "policy_store",
                     StatusCodes.DB_UPDATE_FAILED, policy.toString());
         }
@@ -557,9 +557,8 @@
         try {
             return this.jdbcTemplate.queryForObject(sql1, param, Integer.class);
         }catch (DataAccessException e) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("Operation (SELECT) not possible for '{}' for user '{}'",
-                            policy.getTarget(), user.getId());
+            jlog.error("Operation (SELECT) not possible for '{}' for user '{}'",
+                    policy.getTarget(), user.getId());
             throw new dbException(user.getId(), "policy_store",
                     StatusCodes.DB_GET_FAILED, policy.toString());
         }
@@ -597,9 +596,8 @@
         try {
             return this.jdbcTemplate.queryForObject(sql, param, Integer.class);
         }catch (DataAccessException e) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("Operation (SELECT) not possible for '{}' for user '{}'",
-                            group, user.getId());
+            jlog.error("Operation (SELECT) not possible for '{}' for user '{}'",
+                    group, user.getId());
             throw new dbException(user.getId(), "policy_store",
                     StatusCodes.DB_GET_FAILED, group);
         }
@@ -621,9 +619,8 @@
                             + "VALUES (:name, :sy, :ex, :com);", param, key);
             return key.getKey().intValue();
         }catch (DataAccessException e) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("Operation (INSERT) not possible for '{}'",
-                            condition.toString());
+            jlog.error("Operation (INSERT) not possible for '{}'",
+                    condition.toString());
             throw new dbException(user.getId(), "group_store",
                     StatusCodes.DB_INSERT_FAILED, condition.toString());
         }
@@ -644,9 +641,8 @@
             param.addValue("status", BooleanUtils.getBoolean(admin));
             return this.jdbcTemplate.update(insert, param);
         }catch (DataAccessException e) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("Operation (INSERT) not possible for '{}' for user '{}'",
-                            condition.toString(), username);
+            jlog.error("Operation (INSERT) not possible for '{}' for user '{}'",
+                    condition.toString(), username);
             throw new dbException(null, "group_store",
                     StatusCodes.DB_INSERT_FAILED, condition.toString());
         }
@@ -698,9 +694,8 @@
             //fixme: problem - unique constraints throws exception. skip that user entry?!
             return this.jdbcTemplate.batchUpdate(insert, sources);
         }catch (DataAccessException e) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("Operation (INSERT) not possible for '{}' for user '{}'",
-                            condition.toString(), usernames);
+            jlog.error("Operation (INSERT) not possible for '{}' for user '{}'",
+                    condition.toString(), usernames);
             throw new KustvaktException(e, StatusCodes.CONNECTION_ERROR);
         }
     }
@@ -725,9 +720,8 @@
         try {
             this.jdbcTemplate.batchUpdate(del, sources);
         }catch (DataAccessException e) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("Operation (DELETE) not possible for '{}' for user '{}'",
-                            condition.toString(), usernames);
+            jlog.error("Operation (DELETE) not possible for '{}' for user '{}'",
+                    condition.toString(), usernames);
             throw new KustvaktException(e, StatusCodes.CONNECTION_ERROR);
         }
     }
@@ -748,9 +742,8 @@
         try {
             this.jdbcTemplate.update(insert, source);
         }catch (DataAccessException e) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("Operation (INSERT) not possible for '{}",
-                            param.toString());
+            jlog.error("Operation (INSERT) not possible for '{}",
+                    param.toString());
             throw new KustvaktException(e, StatusCodes.CONNECTION_ERROR);
         }
     }
@@ -766,9 +759,8 @@
         try {
             return this.jdbcTemplate.queryForList(sql1, source, String.class);
         }catch (DataAccessException e) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("Operation (SELECT) not possible for '{}'",
-                            condition.toString());
+            jlog.error("Operation (SELECT) not possible for '{}'",
+                    condition.toString());
             throw new KustvaktException(StatusCodes.CONNECTION_ERROR);
         }
     }
diff --git a/src/main/java/de/ids_mannheim/korap/security/ac/SecurityManager.java b/src/main/java/de/ids_mannheim/korap/security/ac/SecurityManager.java
index 09f48b5..d1fc2b9 100644
--- a/src/main/java/de/ids_mannheim/korap/security/ac/SecurityManager.java
+++ b/src/main/java/de/ids_mannheim/korap/security/ac/SecurityManager.java
@@ -16,7 +16,6 @@
 import de.ids_mannheim.korap.user.User;
 import de.ids_mannheim.korap.utils.KustvaktLogger;
 import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import java.util.*;
 
@@ -32,10 +31,12 @@
 @SuppressWarnings("all")
 public class SecurityManager<T extends KustvaktResource> {
 
-    private static final Logger secLogger = LoggerFactory
-            .getLogger(KustvaktLogger.SECURITY_LOG);
-    private static final Logger errorLogger = LoggerFactory
-            .getLogger(KustvaktLogger.ERROR_LOG);
+    //    private static final Logger errorLogger = LoggerFactory
+    //            .getLogger(KustvaktLogger.ERROR_LOG);
+
+    private static final Logger jlog = KustvaktLogger
+            .getLogger(SecurityManager.class);
+
     private static PolicyHandlerIface policydao;
     private static Map<Class<? extends KustvaktResource>, ResourceOperationIface> handlers;
     private static EncryptionIface crypto;
@@ -66,7 +67,7 @@
         SecurityManager.policydao = policyHandler;
         SecurityManager.crypto = crypto;
         SecurityManager.handlers = new HashMap<>();
-        secLogger.info("Registering handlers: {}", Arrays.asList(ifaces));
+        jlog.info("Registering handlers: {}", Arrays.asList(ifaces));
         for (ResourceOperationIface iface : ifaces)
             handlers.put(iface.getType(), iface);
     }
@@ -138,10 +139,8 @@
         if (evaluator.isAllowed(Permissions.PERMISSIONS.READ)) {
             return this.resource;
         }else {
-            secLogger
-                    .error("Reading the resource '{}' is not allowed for user '{}'",
-                            this.resource.getPersistentID(),
-                            this.user.getUsername());
+            jlog.error("Reading the resource '{}' is not allowed for user '{}'",
+                    this.resource.getPersistentID(), this.user.getUsername());
             throw new NotAuthorizedException(StatusCodes.PERMISSION_DENIED,
                     evaluator.getResourceID());
         }
@@ -157,10 +156,9 @@
                 handlers.get(KustvaktResource.class)
                         .updateResource(resource, this.user);
         }else {
-            secLogger
-                    .error("Updating the resource '{}' is not allowed for user '{}'",
-                            this.resource.getPersistentID(),
-                            this.user.getUsername());
+            jlog.error(
+                    "Updating the resource '{}' is not allowed for user '{}'",
+                    this.resource.getPersistentID(), this.user.getUsername());
             throw new NotAuthorizedException(StatusCodes.PERMISSION_DENIED,
                     this.evaluator.getResourceID());
         }
@@ -214,9 +212,8 @@
         this.evaluator = new PolicyEvaluator(this.user, this.policies);
 
         if (this.policies == null) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("No policies found for resource id '{}' for user '{}'",
-                            id, user.getId());
+            jlog.error("No policies found for resource id '{}' for user '{}'",
+                    id, user.getId());
             throw new EmptyResultException(String.valueOf(id));
         }
         return true;
@@ -226,9 +223,8 @@
     private T findResource(Class type)
             throws NotAuthorizedException, KustvaktException {
         if (!evaluator.isAllowed()) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("Permission denied for resource id '{}' for user '{}'",
-                            this.evaluator.getResourceID(), user.getId());
+            jlog.error("Permission denied for resource id '{}' for user '{}'",
+                    this.evaluator.getResourceID(), user.getId());
             throw new NotAuthorizedException(StatusCodes.PERMISSION_DENIED,
                     this.evaluator.getResourceID());
         }
@@ -262,9 +258,9 @@
                     SecurityManager.findbyId(resource.getParentID(), user,
                             Permissions.PERMISSIONS.ALL);
                 }catch (EmptyResultException e) {
-                    KustvaktLogger.SECURITY_LOGGER
-                            .error("No policies found for parent '{}' for user '{}'",
-                                    resource.getParentID(), user.getId());
+                    jlog.error(
+                            "No policies found for parent '{}' for user '{}'",
+                            resource.getParentID(), user.getId());
                     throw new KustvaktException(StatusCodes.EMPTY_RESULTS);
                 }
             }
@@ -279,10 +275,9 @@
             if (newid | !p.checkResource(resource.getPersistentID(), user)) {
                 resource.setOwner(user.getId());
 
-                KustvaktLogger.SECURITY_LOGGER
-                        .info("Creating Access Control structure for resource '"
-                                + resource.getPersistentID() + "@" + resource
-                                .getId() + "'");
+                jlog.info("Creating Access Control structure for resource '"
+                        + resource.getPersistentID() + "@" + resource.getId()
+                        + "'");
                 // storing resource is called twice. first when this is register and later in idsbootstrap to create cstorage entry. how to unify this?
                 ResourceOperationIface iface = p.handlers
                         .get(resource.getClass());
@@ -301,9 +296,9 @@
                         Permissions.PERMISSIONS.READ_POLICY,
                         Permissions.PERMISSIONS.MODIFY_POLICY);
             }catch (EmptyResultException e) {
-                KustvaktLogger.SECURITY_LOGGER
-                        .error("No policies found for '{}' for user '{}'. Resource could not be registered!",
-                                resource.getPersistentID(), user.getId());
+                jlog.error(
+                        "No policies found for '{}' for user '{}'. Resource could not be registered!",
+                        resource.getPersistentID(), user.getId());
                 throw new KustvaktException(user.getId(),
                         StatusCodes.POLICY_CREATE_ERROR,
                         "Resource could not be registered",
@@ -349,17 +344,15 @@
     public void addPolicy(SecurityPolicy policy, Parameter... params)
             throws KustvaktException, NotAuthorizedException {
         if (policy.getConditions().isEmpty()) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("No conditions set for '{}' for user '{}'",
-                            policy.toString(), this.user.getId());
+            jlog.error("No conditions set for '{}' for user '{}'",
+                    policy.toString(), this.user.getId());
             throw new NotAuthorizedException(StatusCodes.ILLEGAL_ARGUMENT,
                     policy.getTarget());
         }
 
         if (this.policies[0] == null) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("No policies found for '{}' for user '{}'",
-                            this.evaluator.getResourceID(), this.user.getId());
+            jlog.error("No policies found for '{}' for user '{}'",
+                    this.evaluator.getResourceID(), this.user.getId());
             throw new NotAuthorizedException(StatusCodes.UNSUPPORTED_OPERATION,
                     policy.getTarget());
         }
@@ -372,9 +365,9 @@
         if (evaluator.isAllowed(Permissions.PERMISSIONS.CREATE_POLICY)) {
             policydao.createPolicy(policy, this.user);
         }else if (silent) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("Permission Denied (CREATE_POLICY) on '{}' for user '{}'",
-                            this.evaluator.getResourceID(), this.user.getId());
+            jlog.error(
+                    "Permission Denied (CREATE_POLICY) on '{}' for user '{}'",
+                    this.evaluator.getResourceID(), this.user.getId());
             throw new NotAuthorizedException(StatusCodes.PERMISSION_DENIED,
                     policy.getTarget());
         }
@@ -411,9 +404,8 @@
                     this.evaluator.getResourceID());
 
         if (this.policies[0] == null) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("No policies found (DELETE_POLICY) on '{}' for '{}'",
-                            this.evaluator.getResourceID(), this.user.getId());
+            jlog.error("No policies found (DELETE_POLICY) on '{}' for '{}'",
+                    this.evaluator.getResourceID(), this.user.getId());
             throw new KustvaktException(user.getId(), StatusCodes.NO_POLICIES,
                     "no policy desicion possible",
                     this.evaluator.getResourceID());
@@ -422,9 +414,8 @@
                 .isAllowed(Permissions.PERMISSIONS.DELETE_POLICY))) {
             policydao.deletePolicy(policy, this.user);
         }else if (silent) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("Permission Denied (DELETE_POLICY) on '{}' for '{}'",
-                            this.evaluator.getResourceID(), this.user.getId());
+            jlog.error("Permission Denied (DELETE_POLICY) on '{}' for '{}'",
+                    this.evaluator.getResourceID(), this.user.getId());
             throw new NotAuthorizedException(StatusCodes.PERMISSION_DENIED,
                     "no policy desicion possible",
                     this.evaluator.getResourceID());
@@ -440,9 +431,9 @@
             throw new NotAuthorizedException(StatusCodes.ILLEGAL_ARGUMENT);
 
         if (this.policies[0] == null) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("Operation not possible (MODIFY_POLICY) on '{}' for '{}'",
-                            this.evaluator.getResourceID(), this.user.getId());
+            jlog.error(
+                    "Operation not possible (MODIFY_POLICY) on '{}' for '{}'",
+                    this.evaluator.getResourceID(), this.user.getId());
             throw new KustvaktException(user.getId(), StatusCodes.NO_POLICIES,
                     "no policy desicion possible",
                     this.evaluator.getResourceID());
@@ -452,9 +443,8 @@
                 .isAllowed(Permissions.PERMISSIONS.MODIFY_POLICY))) {
             policydao.updatePolicy(policy, this.user);
         }else if (silent) {
-            KustvaktLogger.SECURITY_LOGGER
-                    .error("Permission Denied (DELETE_POLICY) on '{}' for '{}'",
-                            this.evaluator.getResourceID(), this.user.getId());
+            jlog.error("Permission Denied (DELETE_POLICY) on '{}' for '{}'",
+                    this.evaluator.getResourceID(), this.user.getId());
             throw new NotAuthorizedException(StatusCodes.PERMISSION_DENIED,
                     this.evaluator.getResourceID());
         }
diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties
index ff5d34c..ed7269f 100644
--- a/src/main/resources/log4j.properties
+++ b/src/main/resources/log4j.properties
@@ -15,6 +15,12 @@
 log4j.appender.errorLog.layout.ConversionPattern=%d{MMM dd, yyyy HH:mm:ss} %C{6} - %M %n %-5p: %m%n
 log4j.appender.errorLog.File=./logs/errors.log
 
+log4j.appender.policyLog=org.apache.log4j.RollingFileAppender
+log4j.appender.policyLog.layout=org.apache.log4j.PatternLayout
+log4j.appender.policyLog.layout.ConversionPattern=%d{MMM dd, yyyy HH:mm:ss} %C{6} - %M %n %-5p: %m%n
+log4j.appender.policyLog.File=./logs/policies.log
+
+log4j.logger.de.ids_mannheim.korap.security.ac = DEBUG, policyLog
 
 log4j.appender.debugLog=org.apache.log4j.RollingFileAppender
 log4j.appender.debugLog.layout=org.apache.log4j.PatternLayout
diff --git a/src/test/java/de/ids_mannheim/korap/config/ConfigTest.java b/src/test/java/de/ids_mannheim/korap/config/ConfigTest.java
index 4a2ca67..b86699c 100644
--- a/src/test/java/de/ids_mannheim/korap/config/ConfigTest.java
+++ b/src/test/java/de/ids_mannheim/korap/config/ConfigTest.java
@@ -44,7 +44,7 @@
 
         BeanConfiguration.getBeans().getConfiguration().setPropertiesAsStream(
                 ConfigTest.class.getClassLoader()
-                        .getResourceAsStream("kustvakt_test.conf"));
+                        .getResourceAsStream("kustvakt.conf"));
 
         Assert.assertEquals("token layer does not match", "tt",
                 BeanConfiguration.getBeans().getConfiguration()
@@ -61,7 +61,7 @@
 
         BeanConfiguration.getBeans().getConfiguration().setPropertiesAsStream(
                 ConfigTest.class.getClassLoader()
-                        .getResourceAsStream("kustvakt_test.conf"));
+                        .getResourceAsStream("kustvakt.conf"));
 
         String v = "testmail@ids-mannheim.de";
         BeanConfiguration.getBeans().getEncryption().validateEmail(v);
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/KustvaktResourceServiceTest.java b/src/test/java/de/ids_mannheim/korap/web/service/KustvaktResourceServiceTest.java
index 6829064..d44f696 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/KustvaktResourceServiceTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/KustvaktResourceServiceTest.java
@@ -77,12 +77,14 @@
                 .get(ClientResponse.class);
         assert ClientResponse.Status.OK.getStatusCode() == response.getStatus();
         node = JsonUtils.readTree(response.getEntity(String.class));
-        System.out.println("STATS RESULT: ");
-        System.out.println(node);
+        assert node != null;
+        int docs = node.path("documents").asInt();
+        assert docs > 0 && docs < 15;
     }
 
     @Test
     public void testResourceStore() {
 
     }
+
 }
diff --git a/src/test/resources/test-config.xml b/src/test/resources/default-config.xml
similarity index 97%
rename from src/test/resources/test-config.xml
rename to src/test/resources/default-config.xml
index 082d616..a756340 100644
--- a/src/test/resources/test-config.xml
+++ b/src/test/resources/default-config.xml
@@ -69,9 +69,13 @@
         <property name="url" value="${jdbc.url}"/>
         <property name="username" value="${jdbc.username}"/>
         <property name="password" value="${jdbc.password}"/>
+        <!-- relevant for single connection datasource and sqlite -->
         <property name="suppressClose">
             <value>true</value>
         </property>
+        <!--<property name="initialSize" value="2"/>-->
+        <!--<property name="maxIdle" value="2"/>-->
+        <!--<property name="poolPreparedStatements" value="true"/>-->
     </bean>
 
     <!-- to configure database for sqlite, mysql, etc. migrations -->
@@ -99,7 +103,6 @@
         <constructor-arg ref="kustvakt_db"/>
     </bean>
 
-    <!-- deprecated : load via constructor -->
     <!--fixme: change name according to convention -->
     <bean id="collectionProvider"
           class="de.ids_mannheim.korap.handlers.CollectionDao">
diff --git a/src/test/resources/kustvakt_test.conf b/src/test/resources/kustvakt_test.conf
deleted file mode 100644
index 75e549a..0000000
--- a/src/test/resources/kustvakt_test.conf
+++ /dev/null
@@ -1,37 +0,0 @@
-## index dir
-lucene.indexDir	=	/Users/hanl/Projects/prep_corpus
-
-kustvakt.default.pos = tt
-kustvakt.default.lemma = tt
-kustvakt.default.token = tt
-kustvakt.default.dep = mate
-kustvakt.default.const = mate
-
-
-## options referring to the security module!
-
-## token expiration time in minutes!
-## decpricated, no function uses this anymore
-security.absoluteTimeoutDuration = 45M
-
-security.longTokenTTL = 230D
-security.tokenTTL = 72H
-security.shortTokenTTL = 5S
-
-## specifies the user data field that is used to salt user passwords
-security.passcode.salt=accountCreation
-
-security.idleTimeoutDuration = 25M
-security.multipleLogIn = true
-security.loginAttemptNum = 3
-security.authAttemptTTL = 45M
-
-security.encryption.loadFactor = 8
-security.validation.stringLength = 150
-security.validation.emailLength = 5
-security.encryption.algo=BCRYPT
-security.sharedSecret=nHim5JB-YqkX7sS55jayGBnga8WmqgpkzieGe8UhojE
-security.adminToken=f61d02c04a0f18d60172f7b990955824
-
-## applicable: rewrite, foundry, filter, deny
-security.rewrite.strategies=filter, foundry, rewrite
\ No newline at end of file
