From 69132ec5bc165395458e49c421d0f38925d16ec5 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 6 Nov 2020 11:17:30 +0100 Subject: adapt logging to improve debugging --- .../java/at/gv/egiz/eaaf/core/impl/idp/auth/RequestStorage.java | 9 ++++++++- .../egiz/eaaf/core/impl/idp/controller/AbstractController.java | 4 ++-- .../core/impl/idp/controller/ProtocolFinalizationController.java | 5 ++++- 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'eaaf_core/src') diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/RequestStorage.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/RequestStorage.java index 48c9d1bd..86c50be0 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/RequestStorage.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/RequestStorage.java @@ -69,10 +69,17 @@ public class RequestStorage implements IRequestStorage { // search invalid pending-request for errorHandling IRequest invalidPendingRequest = null; - try { + try { if (StringUtils.isNotEmpty(e.getInvalidInternalPendingReqId())) { + log.debug("Searching for expired pendingRequest with Id: {} ... ", e.getInvalidInternalPendingReqId()); invalidPendingRequest = transactionStorage.get(e.getInvalidInternalPendingReqId(), IRequest.class); + log.debug("{} expired pendingReq. Set it into Exception ...", + invalidPendingRequest != null ? "Find" : "Find NO "); + + } else { + log.debug("Get no internal pendingRequestId. Expired pendingRequest can not be set"); + } } catch (final EaafException e1) { diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractController.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractController.java index 41c7a432..0479a8c5 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractController.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractController.java @@ -181,7 +181,7 @@ public abstract class AbstractController { final byte[] serializedError = SerializationUtils.serialize( new ExceptionContainer(errorToHandle.getFirst(), errorToHandle.getSecond())); - log.trace("Put 'ExceptionContainer' into cache ... "); + log.debug("Put 'ExceptionContainer' into cache with id: {}... ", errorKey); transactionStorage.put(errorKey, serializedError, -1); } else { @@ -189,7 +189,7 @@ public abstract class AbstractController { final byte[] serializedError = SerializationUtils.serialize( new ExceptionContainer(null, errorToHandle.getSecond())); - log.trace("Put 'ExceptionContainer' into cache ... "); + log.trace("Put 'ExceptionContainer' into cache with id: {}... ",errorKey); transactionStorage.put(errorKey, serializedError, -1); } diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/ProtocolFinalizationController.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/ProtocolFinalizationController.java index 2a8dd756..9511f46e 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/ProtocolFinalizationController.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/ProtocolFinalizationController.java @@ -76,6 +76,7 @@ public class ProtocolFinalizationController extends AbstractController { IRequest pendingReq = null; try { String errorId = requestIdValidationStragegy.validateAndGetPendingRequestId(errorToken); + log.debug("Searching exception with internal error-token: {}", errorId); // load stored exception from database final byte[] containerSerialized = @@ -83,7 +84,8 @@ public class ProtocolFinalizationController extends AbstractController { if (containerSerialized != null) { // remove exception if it was found transactionStorage.remove(errorId); - + log.trace("Find exception with internal error-token: {}", errorId); + //final Object containerObj = EaafSerializationUtils.deserialize(containerSerialized, // Arrays.asList( // ExceptionContainer.class.getName() @@ -115,6 +117,7 @@ public class ProtocolFinalizationController extends AbstractController { } } else { + log.info("Find no exception with internal error-token: {}", errorId); protAuthService.handleErrorNoRedirect( new EaafException(IStatusMessenger.CODES_INTERNAL_ERROR_AUTH_NOPENDIGREQID, null), req, resp, false); -- cgit v1.2.3