Package general.common
Class StudyLogger
- java.lang.Object
-
- general.common.StudyLogger
-
@Singleton public class StudyLogger extends java.lang.ObjectStudyLogger provides logging for JATOS studies. Each study gets it's own log usually created while the study is created.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 Summary
Constructors Constructor Description StudyLogger()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreate(Study study)java.lang.StringgetFilename(Study study)java.lang.StringgetPath(Study study)java.lang.StringgetRetiredFilename(Study study)java.lang.StringgetRetiredPath(Study study)voidlog(StudyLink studyLink, java.lang.String msg, Worker worker)voidlog(Study study, java.lang.String msg, Worker worker)voidlog(Study study, User user, java.lang.String msg)voidlog(Study study, User user, java.lang.String msg, Batch batch)voidlog(Study study, User user, java.lang.String msg, org.apache.commons.lang3.tuple.Pair<java.lang.String,java.lang.Object> additionalInfo)voidlogResultDataStoring(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 IDvoidlogResultUploading(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 IDvoidlogStudyDescriptionHash(Study study, User user)akka.stream.javadsl.Source<akka.util.ByteString,?>readLogFile(Study study, int entryLimit)java.lang.Stringretire(Study study)
-
-
-
Method Detail
-
getFilename
public java.lang.String getFilename(Study study)
-
getPath
public java.lang.String getPath(Study study)
-
getRetiredFilename
public java.lang.String getRetiredFilename(Study study)
-
getRetiredPath
public java.lang.String getRetiredPath(Study study)
-
create
public void create(Study study)
-
retire
public java.lang.String retire(Study study)
-
log
public void log(Study study, User user, java.lang.String msg, org.apache.commons.lang3.tuple.Pair<java.lang.String,java.lang.Object> additionalInfo)
-
logResultUploading
public void logResultUploading(java.nio.file.Path file, ComponentResult componentResult) throws java.io.IOExceptionAdds an entry to the study log: adds the hash of the file, component UUID, and the worker ID- Parameters:
file- File that will be stored- Throws:
java.io.IOException
-
logResultDataStoring
public 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- Parameters:
componentResult- ComponentResults that will be stored
-
readLogFile
public akka.stream.javadsl.Source<akka.util.ByteString,?> readLogFile(Study study, int entryLimit)
- Parameters:
study- the study of which log will be readentryLimit- number of max entries will be read from the log
-
-