diff options
author | Thomas <> | 2022-10-24 08:49:08 +0200 |
---|---|---|
committer | Thomas <> | 2022-10-24 08:49:08 +0200 |
commit | d635106892599a65fe663a2c27118f7936d2359d (patch) | |
tree | b8e21b1e86bf19fb01a487f610c36a61e3d138f7 | |
parent | c25f53f2ae3522f2cea1707b8869187013bba8e9 (diff) | |
download | National_eIDAS_Gateway-d635106892599a65fe663a2c27118f7936d2359d.tar.gz National_eIDAS_Gateway-d635106892599a65fe663a2c27118f7936d2359d.tar.bz2 National_eIDAS_Gateway-d635106892599a65fe663a2c27118f7936d2359d.zip |
chore(logging): change advanced statistic log to include matching details in error-case too
-rw-r--r-- | ms_specific_connector/src/main/java/at/asitplus/eidas/specific/core/logger/AdvancedStatisicLogger.java | 27 |
1 files changed, 22 insertions, 5 deletions
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 |