Added LDAP log for users without idsC2Profile.
Change-Id: Ie5256979b7da10eef4092ecc03edc8eabc57c24d
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/LdapAuth3.java b/full/src/main/java/de/ids_mannheim/korap/authentication/LdapAuth3.java
index a597f62..15b1b56 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/LdapAuth3.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/LdapAuth3.java
@@ -15,6 +15,8 @@
import javax.net.ssl.SSLSocketFactory;
import org.apache.commons.text.StringSubstitutor;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import com.unboundid.ldap.sdk.BindResult;
import com.unboundid.ldap.sdk.Filter;
@@ -50,6 +52,7 @@
public static final int LDAP_AUTH_RNAUTH = 7; // User Account or Pwd unknown, or not authorized
final static Boolean DEBUGLOG = false; // log debug output.
+ private static Logger jlog = LogManager.getLogger(LdapAuth3.class);
public static String getErrMessage(int code) {
switch (code) {
@@ -279,6 +282,7 @@
username = entry.getAttributeValue(idsC2Attribute);
if (username == null) {
username = entry.getAttributeValue(uidAttribute);
+ jlog.warn("idsC2Profile not found for uid: "+username);
}
}
return username;
diff --git a/full/src/main/resources/log4j2.properties b/full/src/main/resources/log4j2.properties
index c366776..76fd08f 100644
--- a/full/src/main/resources/log4j2.properties
+++ b/full/src/main/resources/log4j2.properties
@@ -1,3 +1,4 @@
+#appenders = console, mainFile, ldapFile
appenders = console, mainFile
appender.console.type = Console
appender.console.name = STDOUT
@@ -10,6 +11,13 @@
appender.mainFile.layout.type=PatternLayout
appender.mainFile.layout.pattern= %d{yyyy-MM-dd, HH:mm:ss} %C{6} - %M%n %-5p: %m%n
+#appender.ldapFile.type = File
+#appender.ldapFile.name = LDAP_LOG
+#appender.ldapFile.fileName=./logs/ldap.log
+#appender.ldapFile.layout.type=PatternLayout
+#appender.ldapFile.layout.pattern= %d{yyyy-MM-dd, HH:mm:ss} %C{6} - %M%n %-5p: %m%n
+
+
rootLogger.level = warn
rootLogger.appenderRefs = console,mainFile
rootLogger.appenderRef.file.ref = MAINLOG
@@ -27,4 +35,11 @@
logger.console.level = warn
logger.console.appenderRefs = file
logger.console.appenderRef.file.ref = MAINLOG
-logger.console.additivity=false
\ No newline at end of file
+logger.console.additivity=false
+
+#loggers=file
+#logger.file.name=de.ids_mannheim.korap.authentication.LdapAuth3
+#logger.file.level = info
+#logger.file.appenderRefs = file
+#logger.file.appenderRef.file.ref = LDAP_LOG
+#logger.file.additivity=false
\ No newline at end of file