Package com.avoka.tm.svc
Class EventLogger
java.lang.Object
com.avoka.tm.svc.EventLogger
Provides an Event Logger service which will log [ INFO, WARN | ERROR | SECURITY ] events to the Transact event log database table.
Event Log records are not encrypted and should not contain sensitive PII data.
Examples
Please find the event logger examples below.Create Info Event Log Record
The example below creates a 'Info' Event Log record associated with the specified transaction record.
import com.avoka.tm.svc.* new EventLogger() .setMessage("IDV-Status - application completed") .setTxn(txn) .logInfo()
Create Security Event Log Record
The example below creates a 'Security' Event Log record associated with the specified transaction record. This example configures the EventLogger not to write the sensitive event log message to the server.log file.
import com.avoka.tm.svc.* new EventLogger() .setMessage("Fraud Event with application : " + txn.formStatus + " : " + txn.formDataMap) .setRequest(request) .setTxn(txn) .setWriteToLogger(false) .logSecurity()
- Since:
- 5.0.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
logError()
Log an Error event log record.void
logInfo()
Log an Information event log record.void
Log an Security event log record.void
Log an Warning event log record.setMessage
(String message) Set the event log message property.setRequest
(HttpServletRequest request) Set the request property to log.Set the transaction to associate with the event log.Set the transaction record id to associate with the event log.setWriteToLogger
(boolean writeToLogger) Specify whether to write a message to the Log4J server.log file.
-
Constructor Details
-
EventLogger
public EventLogger()
-
-
Method Details
-
setMessage
Set the event log message property.- Parameters:
message
- the message to log- Returns:
- the event logger
-
setRequest
Set the request property to log.- Parameters:
request
- the message to log- Returns:
- the event logger
-
setTxn
Set the transaction to associate with the event log.- Parameters:
txn
- the transaction to associate with the event log- Returns:
- the event logger
-
setTxnId
Set the transaction record id to associate with the event log.- Parameters:
txnId
- the transaction record id to associate with the event log- Returns:
- the event logger
-
setWriteToLogger
Specify whether to write a message to the Log4J server.log file.- Parameters:
writeToLogger
- specify whether to write a message to the Log4J server.log file- Returns:
- the event logger
-
logInfo
public void logInfo()Log an Information event log record. -
logWarning
public void logWarning()Log an Warning event log record. -
logError
public void logError()Log an Error event log record. -
logSecurity
public void logSecurity()Log an Security event log record.
-