@Singleton
public class StudyLogger
extends java.lang.Object
Major events are written into this log: - study creation/deletion/recreation - batch creation/deletion - study run start/stops/aborts - result data storing - NOT logging any user adding/removing
Whenever the log entry handles result data a SHA-256 hash of the data is included in the log. If it exports files a SHA-256 hash of the content of the file is included in the log.
The log uses charset ISO_8859_1.
Constructor and Description |
---|
StudyLogger() |
Modifier and Type | Method and Description |
---|---|
void |
create(Study study) |
java.lang.String |
getFilename(Study study) |
java.lang.String |
getPath(Study study) |
java.lang.String |
getRetiredFilename(Study study) |
java.lang.String |
getRetiredPath(Study study) |
void |
log(StudyLink studyLink,
java.lang.String msg,
Worker worker) |
void |
log(Study study,
java.lang.String msg,
Worker worker) |
void |
log(Study study,
User user,
java.lang.String msg) |
void |
log(Study study,
User user,
java.lang.String msg,
Batch batch) |
void |
log(Study study,
User user,
java.lang.String msg,
org.apache.commons.lang3.tuple.Pair<java.lang.String,java.lang.Object> additionalInfo) |
void |
logResultDataStoring(ComponentResult componentResult,
java.lang.String data,
boolean append)
Adds an entry to the study log: adds the hash of the result data, component UUID, and the worker ID
|
void |
logResultUploading(java.nio.file.Path file,
ComponentResult componentResult)
Adds an entry to the study log: adds the hash of the file, component UUID, and the worker ID
|
void |
logStudyDescriptionHash(Study study,
User user) |
akka.stream.javadsl.Source<akka.util.ByteString,?> |
readLogFile(Study study,
int entryLimit) |
java.lang.String |
retire(Study study) |
public java.lang.String getFilename(Study study)
public java.lang.String getPath(Study study)
public java.lang.String getRetiredFilename(Study study)
public java.lang.String getRetiredPath(Study study)
public void create(Study study)
public java.lang.String retire(Study study)
public void log(Study study, User user, java.lang.String msg, org.apache.commons.lang3.tuple.Pair<java.lang.String,java.lang.Object> additionalInfo)
public void logResultUploading(java.nio.file.Path file, ComponentResult componentResult) throws java.io.IOException
file
- File that will be storedjava.io.IOException
public void logResultDataStoring(ComponentResult componentResult, java.lang.String data, boolean append)
componentResult
- ComponentResults that will be storedpublic akka.stream.javadsl.Source<akka.util.ByteString,?> readLogFile(Study study, int entryLimit)
study
- the study of which log will be readentryLimit
- number of max entries will be read from the log