Record Class EventData

java.lang.Object
java.lang.Record
net.tangly.commons.logger.EventData
Record Components:
event - event triggering the creation of an audit log
timestamp - timestamp when the audit log was created
component - component source of the audit log. By convention, we use the module name or if necessary the package name
status - status associated with the audit log
text - text of the audit log. It should be English and provide a concise description of the event
data - data specific to the audit log
exception - optional exception to be added to the audit log

public record EventData(@NotNull String event, @NotNull LocalDateTime timestamp, @NotNull String component, @NotNull EventData.Status status, String text, @NotNull Map<String,Object> data, Throwable exception) extends Record
Provide a simple approach to create an audit trail for all relevant operations performed in the system. Contextual information such as user, IP address are part of the MDR context and implicitly available to the event data logging process.

Good practice is to log all incoming and outgoing data. The granularity should be an aggregate as defined in the domain-driven design approach. The goal is provide an audit trail for all relevant input and output operations performed in the system.

Statuses are:

Success
A complex operation was completed successfully. For example all entities of a TSV file could be imported.
Info
Status information of a completed system activity. For example one entity of a TSV file could be imported.
Warning
The operation encountered a problem but the data could be processed.
Error
The data could not be processed due to syntactic or semantic errors.
Failure
The operation failed due to an internal or resource problem. For example the file could be found or read.