From d635106892599a65fe663a2c27118f7936d2359d Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Mon, 24 Oct 2022 08:49:08 +0200 Subject: chore(logging): change advanced statistic log to include matching details in error-case too --- .../core/logger/AdvancedStatisicLogger.java | 27 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'ms_specific_connector/src/main/java/at') diff --git a/ms_specific_connector/src/main/java/at/asitplus/eidas/specific/core/logger/AdvancedStatisicLogger.java b/ms_specific_connector/src/main/java/at/asitplus/eidas/specific/core/logger/AdvancedStatisicLogger.java index 6cbe11bf..cfa93286 100644 --- a/ms_specific_connector/src/main/java/at/asitplus/eidas/specific/core/logger/AdvancedStatisicLogger.java +++ b/ms_specific_connector/src/main/java/at/asitplus/eidas/specific/core/logger/AdvancedStatisicLogger.java @@ -38,7 +38,7 @@ import lombok.extern.slf4j.Slf4j; @Slf4j public class AdvancedStatisicLogger implements IStatisticLogger { - private static final String DATEFORMATER = "yyyy.MM.dd-HH:mm:ss+z"; + private static final String DATEFORMATER = "yyyy.MM.dd-HH:mm:ss"; private static final String DEFAULT_NO_IDP_ID = "no idpId available"; private static final String DEFAULT_NO_SP_ID = "no appId available"; @@ -62,9 +62,11 @@ public class AdvancedStatisicLogger implements IStatisticLogger { entry.setSuccess(SuccessEntry.builder() .spSector(protocolRequest.getServiceProviderConfiguration().getAreaSpecificTargetIdentifier()) .citizenCountryCode(authData.getCiticenCountryCode()) + .build()); + entry.setMatching(MatchingDetails.builder() .matchingMethod(extractMatchingState(protocolRequest)) - .matchingDetails(extractMatchingDetails(protocolRequest)) - .build()); + .matchingDetails(extractMatchingDetails(protocolRequest)) + .build()); writeEntryToLog(entry); } @@ -79,6 +81,10 @@ public class AdvancedStatisicLogger implements IStatisticLogger { public void logErrorOperation(Throwable throwable, IRequest errorRequest) { final StatisticLogEntry entry = buildCoreEntry(errorRequest); entry.setError(new ErrorEntry(messageService.getResponseErrorCode(throwable), throwable.getMessage())); + entry.setMatching(MatchingDetails.builder() + .matchingMethod(extractMatchingState(errorRequest)) + .matchingDetails(extractMatchingDetails(errorRequest)) + .build()); writeEntryToLog(entry); } @@ -161,6 +167,9 @@ public class AdvancedStatisicLogger implements IStatisticLogger { @JsonProperty("error") private ErrorEntry error; + + @JsonProperty("idenityMatching") + private MatchingDetails matching; } @@ -175,15 +184,23 @@ public class AdvancedStatisicLogger implements IStatisticLogger { @JsonProperty("ccc") private final String citizenCountryCode; + + } + + @Getter + @Setter + @Builder + @JsonInclude(Include.NON_NULL) + private static class MatchingDetails { @JsonProperty("finalMatchingMethod") private final String matchingMethod; @JsonProperty("matchingProcessDetails") private final DetailedMatchtingStatistic matchingDetails; - + } - + @Getter @Setter @RequiredArgsConstructor -- cgit v1.2.3