LogRecord API

LogRecord is used to store two types of logs.

The following example code executes an update operation and examines the log records for the Customer MBO:

int id = 101;
Customer result = Customer.findById(id);
result.setFname(“newFname”);
result.save();
result.submitPending();
<PkgName>DB.synchronize();
result = Customer.findById(id);
com.sybase.collections.ObjectList logs = result.getLogRecords();
for( iint i=0 ; i<logs.count(); i++)
{
com.sybase.persistence.LogRecord log = logs.getByIndex(i);
System.out.println("Message: " + log.getMessage());
System.out.println("Component: " + log.getComponent());
System.out.println("Operation: " + log.getOperation());
System.out.println("Timestamp: " + log.getTimestamp());
...
}