Update LDAP logs using JLog to include timestamp
and move it from system.out to ldap.log
Change-Id: I62b5090415182d78963df38a0f84e9de8b089d4a
diff --git a/Changes b/Changes
index 6d71fec..24bd595 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,8 @@
+# version 0.78.2
+
+- Update LDAP logs using JLog to include timestamp and move it from system.out
+ to ldap.log
+
# version 0.78.1
- Fix empty security context in statistics requests.
diff --git a/pom.xml b/pom.xml
index be6c2a6..33ebc65 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.ids-mannheim.korap.kustvakt</groupId>
<artifactId>Kustvakt</artifactId>
- <version>0.78.1</version>
+ <version>0.78.2</version>
<properties>
<java.version>17</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
diff --git a/src/main/java/de/ids_mannheim/korap/authentication/LdapAuth3.java b/src/main/java/de/ids_mannheim/korap/authentication/LdapAuth3.java
index 03c4a5d..37a7233 100644
--- a/src/main/java/de/ids_mannheim/korap/authentication/LdapAuth3.java
+++ b/src/main/java/de/ids_mannheim/korap/authentication/LdapAuth3.java
@@ -152,7 +152,8 @@
lc = new LDAPConnection(socketFactory);
}
catch (GeneralSecurityException e) {
- System.err.printf(
+ //jlog.error(
+ jlog.error(
"Error: login: Connecting to LDAPS Server: failed: '%s'!\n",
e);
ldapTerminate(null);
@@ -172,7 +173,7 @@
catch (LDAPException e) {
String fullStackTrace = org.apache.commons.lang.exception.ExceptionUtils
.getFullStackTrace(e);
- System.err.printf(
+ jlog.error(
"Error: login: Connecting to LDAP Server: failed: '%s'!\n",
fullStackTrace);
ldapTerminate(lc);
@@ -192,7 +193,7 @@
System.out.print("Binding: OK.\n");
}
catch (LDAPException e) {
-// System.err.printf("Error: login: Binding failed: '%s'!\n", e);
+// jlog.error("Error: login: Binding failed: '%s'!\n", e);
String error = String.format("Error: login: Binding failed: "
+ "'%s'!\n", e);
jlog.error(error);
@@ -221,7 +222,7 @@
srchRes.getEntryCount());
}
catch (LDAPSearchException e) {
- System.err.printf("Error: Search for User failed: '%s'!\n", e);
+ jlog.error("Error: Search for User failed: '%s'!\n", e);
}
if (srchRes == null || srchRes.getEntryCount() == 0) {
@@ -249,7 +250,7 @@
}
}
catch (LDAPException e) {
-// System.err.printf("Error: login: Binding failed: '%s'!\n", e);
+// jlog.error("Error: login: Binding failed: '%s'!\n", e);
String error = String.format("Error: login: Binding failed: "
+ "'%s'!\n", e);
jlog.error(error);
@@ -303,7 +304,7 @@
srchRes.getEntryCount());
}
catch (LDAPSearchException e) {
- System.err.printf("Error: Search for User failed: '%s'!\n", e);
+ jlog.error("Error: Search for User failed: '%s'!\n", e);
}
return srchRes;
}