summaryrefslogtreecommitdiff
path: root/eaaf_core/src
diff options
context:
space:
mode:
authorlalber <lukas.alber@iaik.tugraz.at>2021-04-14 21:54:08 +0200
committerlalber <lukas.alber@iaik.tugraz.at>2021-04-14 21:54:08 +0200
commit4a418d3a55752850891dbb9a6b10d03728a27520 (patch)
tree1eed3c95f4659d250088b7aa6367fe81261c4a31 /eaaf_core/src
parentb14c0c9ff91a9ef1a3236f5bbf41278f6d0a4725 (diff)
downloadEAAF-Components-4a418d3a55752850891dbb9a6b10d03728a27520.tar.gz
EAAF-Components-4a418d3a55752850891dbb9a6b10d03728a27520.tar.bz2
EAAF-Components-4a418d3a55752850891dbb9a6b10d03728a27520.zip
log level via config
Diffstat (limited to 'eaaf_core/src')
-rw-r--r--eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/IErrorService.java17
-rw-r--r--eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java32
2 files changed, 8 insertions, 41 deletions
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/IErrorService.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/IErrorService.java
index 3f4b7f5e..812a5171 100644
--- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/IErrorService.java
+++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/IErrorService.java
@@ -4,6 +4,7 @@ import at.gv.egiz.eaaf.core.api.gui.ModifyableGuiBuilderConfiguration;
import at.gv.egiz.eaaf.core.exceptions.EaafException;
import javax.servlet.http.HttpServletRequest;
+import java.util.HashSet;
public interface IErrorService {
/**
@@ -82,18 +83,10 @@ public interface IErrorService {
Throwable getThrowable();
/**
- * Logs error to technical log.
- */
- void log_error();
-
- /**
- * Logs info to technical log.
- */
- void log_info();
-
- /**
- * Logs warn to technical log.
+ * Write a Exception to the MOA-ID-Auth internal technical log.
+ *
+ * @param logOnInfoLevel set of what to log on info logging lvl
*/
- void log_warn();
+ void logExceptionToTechnicalLog(HashSet<String> logOnInfoLevel);
}
}
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java
index be24d586..ffa1163f 100644
--- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java
+++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java
@@ -247,7 +247,7 @@ public class ProtocolAuthenticationService implements IProtocolAuthenticationSer
// log Error to technical log
- logExceptionToTechnicalLog(errorData);
+ errorData.logExceptionToTechnicalLog(logOnInfoLevel);
// log Error Message
statisticLogger.logErrorOperation(throwable, protocolRequest);
@@ -260,7 +260,7 @@ public class ProtocolAuthenticationService implements IProtocolAuthenticationSer
if (handlingModule.generateErrorMessage(throwable, req, resp, protocolRequest)) {
// log Error to technical log
- logExceptionToTechnicalLog(errorData);
+ errorData.logExceptionToTechnicalLog(logOnInfoLevel);
// log Error Message
statisticLogger.logErrorOperation(throwable, protocolRequest);
@@ -321,7 +321,7 @@ public class ProtocolAuthenticationService implements IProtocolAuthenticationSer
}
// write errror to console
- logExceptionToTechnicalLog(errorData);
+ errorData.logExceptionToTechnicalLog(logOnInfoLevel);
if (errorData.getActionType().equals(IErrorService.ActionType.NOTICKET_NOREDIRECT) || errorData
.getActionType().equals(IErrorService.ActionType.TICKET_NOREDIRECT)) {
@@ -413,32 +413,6 @@ public class ProtocolAuthenticationService implements IProtocolAuthenticationSer
}
- /**
- * Write a Exception to the MOA-ID-Auth internal technical log.
- *
- * @param data errordata structure
- */
- protected void logExceptionToTechnicalLog(IErrorService.IHandleData data) {
- // In case of a TaskExecutionException, which is only a container for process-errors,
- // extract internal exception
-
-
- // Log exception
- if (!(data.getThrowable() instanceof EaafException)) {
- data.log_error();
-
- } else {
-
- if (logOnInfoLevel.contains(data.getInternalErrorCode())) {
- data.log_info();
-
- } else {
- data.log_warn();
-
- }
- }
- }
-
@PostConstruct
private void initializer() {