-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/hotfix/106_DSF_0.9.0_Backport' into
release/0.6.0.1
- Loading branch information
Showing
62 changed files
with
228 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 56 additions & 7 deletions
63
...a/de/netzwerk_universitaetsmedizin/codex/processes/data_transfer/logging/ErrorLogger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,90 @@ | ||
package de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.logging; | ||
|
||
import java.util.Objects; | ||
|
||
import org.highmed.dsf.bpe.service.MailService; | ||
import org.hl7.fhir.r4.model.IdType; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.beans.factory.InitializingBean; | ||
|
||
public class ErrorLogger | ||
public class ErrorLogger implements InitializingBean | ||
{ | ||
private static final Logger validationLogger = LoggerFactory.getLogger("validation-error-logger"); | ||
private static final Logger errorLogger = LoggerFactory.getLogger("error-logger"); | ||
|
||
private final MailService mailService; | ||
|
||
private final boolean sendValidationFailedMail; | ||
private final boolean sendProcessFailedMail; | ||
|
||
public ErrorLogger(MailService mailService, boolean sendValidationFailedMail, boolean sendProcessFailedMail) | ||
{ | ||
this.mailService = mailService; | ||
|
||
this.sendValidationFailedMail = sendValidationFailedMail; | ||
this.sendProcessFailedMail = sendProcessFailedMail; | ||
} | ||
|
||
@Override | ||
public void afterPropertiesSet() throws Exception | ||
{ | ||
Objects.requireNonNull(mailService, "mailService"); | ||
} | ||
|
||
public void logValidationFailed(IdType taskId) | ||
{ | ||
validationLogger.debug("Validation of FHIR resources failed, started by Task {}", taskId.getValue()); | ||
validationLogger.debug("Validation of FHIR resources failed in process started by {}", | ||
taskId.toVersionless().getValue()); | ||
|
||
if (sendValidationFailedMail) | ||
mailService.send("Validation Error", | ||
"Validation of FHIR resources failed in process started by " + taskId.toVersionless().getValue()); | ||
} | ||
|
||
public void logValidationFailedLocal(IdType taskId) | ||
{ | ||
validationLogger.debug("Local validation of FHIR resources failed, started by Task {}", taskId.getValue()); | ||
validationLogger.debug("Local validation of FHIR resources failed in process started by {}", | ||
taskId.toVersionless().getValue()); | ||
|
||
if (sendValidationFailedMail) | ||
mailService.send("Validation Error", "Local validation of FHIR resources failed in process started by " | ||
+ taskId.toVersionless().getValue()); | ||
} | ||
|
||
public void logValidationFailedRemote(IdType taskId) | ||
{ | ||
validationLogger.debug("Remote validation of FHIR resources failed, started by Task {}", taskId.getValue()); | ||
validationLogger.debug("Remote validation of FHIR resources failed in process started by {}", | ||
taskId.toVersionless().getValue()); | ||
|
||
if (sendValidationFailedMail) | ||
mailService.send("Validation Error", "Remote validation of FHIR resources failed in process started by " | ||
+ taskId.toVersionless().getValue()); | ||
} | ||
|
||
public void logDataSendFailed(IdType taskId) | ||
{ | ||
errorLogger.debug("Send process failed, started by Task {}", taskId.getValue()); | ||
errorLogger.debug("Send process failed started by {}", taskId.toVersionless().getValue()); | ||
|
||
if (sendProcessFailedMail) | ||
mailService.send("Proccess Failed", "Send process failed started by " + taskId.toVersionless().getValue()); | ||
} | ||
|
||
public void logDataTranslateFailed(IdType taskId) | ||
{ | ||
errorLogger.debug("Translate process failed, started by Task {}", taskId.getValue()); | ||
errorLogger.debug("Translate process failed started by {}", taskId.toVersionless().getValue()); | ||
|
||
if (sendProcessFailedMail) | ||
mailService.send("Proccess Failed", | ||
"Translate process failed started by " + taskId.toVersionless().getValue()); | ||
} | ||
|
||
public void logDataReceiveFailed(IdType taskId) | ||
{ | ||
errorLogger.debug("Receive process failed, started by Task {}", taskId.getValue()); | ||
errorLogger.debug("Receive process failed started by {}", taskId.toVersionless().getValue()); | ||
|
||
if (sendProcessFailedMail) | ||
mailService.send("Proccess Failed", | ||
"Receive process failed started by " + taskId.toVersionless().getValue()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.