Skip to content

LogEntryEventBuilder

LogEntryEventBuilder Class

SUPPRESSWARNINGS

Builder class that generates each LogEntryEvent__e record

Group Logger Engine

See Logger

Methods

addTag(tag)

Appends the tag to the existing list of tags

Signature

global LogEntryEventBuilder addTag(String tag)

Parameters

NameTypeDescription
tagStringThe string to use as a tag for the current entry

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


addTags(tags)

Appends the tag to the existing list of tags

Signature

global LogEntryEventBuilder addTags(List<String> tags)

Parameters

NameTypeDescription
tagsListThe list of strings to use as tags for the current entry

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


getLogEntryEvent()

Returns the LogEntryEvent__e record for this instance of LogEntryEventBuilder

Signature

global LogEntryEvent__e getLogEntryEvent()

Return Type

LogEntryEvent__e

The LogEntryEvent__e record


parseStackTrace(stackTraceString)

SUPPRESSWARNINGS

Parses the provided stack trace and sets the log entry’s origin & stack trace fields

Signature

global LogEntryEventBuilder parseStackTrace(String stackTraceString)

Parameters

NameTypeDescription
stackTraceStringStringThe Apex stack trace string to parse

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setApprovalResult(lockResult)

Sets the log entry event’s database operation result fields

Signature

global LogEntryEventBuilder setApprovalResult(Approval.LockResult lockResult)

Parameters

NameTypeDescription
lockResultApproval.LockResultThe instance of Approval.LockResult to log

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setApprovalResult(processResult)

Sets the log entry event’s database operation result fields

Signature

global LogEntryEventBuilder setApprovalResult(Approval.ProcessResult processResult)

Parameters

NameTypeDescription
processResultApproval.ProcessResultThe instance of Approval.ProcessResult to log

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setApprovalResult(unlockResult)

Sets the log entry event’s database operation result fields

Signature

global LogEntryEventBuilder setApprovalResult(Approval.UnlockResult unlockResult)

Parameters

NameTypeDescription
unlockResultApproval.UnlockResultThe instance of Approval.UnlockResult to log

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setApprovalResult(lockResults)

Sets the log entry event’s database operation result fields

Signature

global LogEntryEventBuilder setApprovalResult(List<Approval.LockResult> lockResults)

Parameters

NameTypeDescription
lockResultsList<Approval.LockResult>The list of Approval.LockResult instances to log

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setApprovalResult(processResults)

Sets the log entry event’s database operation result fields

Signature

global LogEntryEventBuilder setApprovalResult(List<Approval.ProcessResult> processResults)

Parameters

NameTypeDescription
processResultsList<Approval.ProcessResult>The list of Approval.ProcessResult instances to log

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setApprovalResult(unlockResults)

Sets the log entry event’s database operation result fields

Signature

global LogEntryEventBuilder setApprovalResult(List<Approval.UnlockResult> unlockResults)

Parameters

NameTypeDescription
unlockResultsList<Approval.UnlockResult>The list of Approval.UnlockResult instances to log

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setDatabaseResult(deleteResult)

Sets the log entry event’s database operation result fields

Signature

global LogEntryEventBuilder setDatabaseResult(Database.DeleteResult deleteResult)

Parameters

NameTypeDescription
deleteResultDatabase.DeleteResultThe instance of Database.DeleteResult to log

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setDatabaseResult(emptyRecycleBinResult)

Sets the log entry event’s database operation result fields

Signature

global LogEntryEventBuilder setDatabaseResult(Database.EmptyRecycleBinResult emptyRecycleBinResult)

Parameters

NameTypeDescription
emptyRecycleBinResultDatabase.EmptyRecycleBinResultThe instance of Database.EmptyRecycleBinResult to log

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setDatabaseResult(leadConvertResult)

Sets the log entry event’s database operation result fields

Signature

global LogEntryEventBuilder setDatabaseResult(Database.LeadConvertResult leadConvertResult)

Parameters

NameTypeDescription
leadConvertResultDatabase.LeadConvertResultThe instance of Database.LeadConvertResult to log

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setDatabaseResult(mergeResult)

Sets the log entry event’s database operation result fields

Signature

global LogEntryEventBuilder setDatabaseResult(Database.MergeResult mergeResult)

Parameters

NameTypeDescription
mergeResultDatabase.MergeResultThe instance of Database.MergeResult to log

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setDatabaseResult(saveResult)

Sets the log entry event’s database operation result fields

Signature

global LogEntryEventBuilder setDatabaseResult(Database.SaveResult saveResult)

Parameters

NameTypeDescription
saveResultDatabase.SaveResultThe instance of Database.SaveResult to log

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setDatabaseResult(upsertResult)

Sets the log entry event’s database operation result fields

Signature

global LogEntryEventBuilder setDatabaseResult(Database.UpsertResult upsertResult)

Parameters

NameTypeDescription
upsertResultDatabase.UpsertResultThe instance of Database.UpsertResult to log

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setDatabaseResult(undeleteResult)

Sets the log entry event’s database operation result fields

Signature

global LogEntryEventBuilder setDatabaseResult(Database.UndeleteResult undeleteResult)

Parameters

NameTypeDescription
undeleteResultDatabase.UndeleteResultThe instance of Database.UndeleteResult to log

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setDatabaseResult(deleteResults)

Sets the log entry event’s database operation result fields

Signature

global LogEntryEventBuilder setDatabaseResult(List<Database.DeleteResult> deleteResults)

Parameters

NameTypeDescription
deleteResultsList<Database.DeleteResult>The list of Database.DeleteResult instances to log

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setDatabaseResult(emptyRecycleBinResults)

Sets the log entry event’s database operation result fields

Signature

global LogEntryEventBuilder setDatabaseResult(List<Database.EmptyRecycleBinResult> emptyRecycleBinResults)

Parameters

NameTypeDescription
emptyRecycleBinResultsList<Database.EmptyRecycleBinResult>The list of Database.EmptyRecycleBinResult instances to log

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setDatabaseResult(leadConvertResults)

Sets the log entry event’s database operation result fields

Signature

global LogEntryEventBuilder setDatabaseResult(List<Database.LeadConvertResult> leadConvertResults)

Parameters

NameTypeDescription
leadConvertResultsList<Database.LeadConvertResult>The list of Database.LeadConvertResult s to log

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setDatabaseResult(mergeResults)

Sets the log entry event’s database operation result fields

Signature

global LogEntryEventBuilder setDatabaseResult(List<Database.MergeResult> mergeResults)

Parameters

NameTypeDescription
mergeResultsList<Database.MergeResult>The list of Database.MergeResult instances to log

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setDatabaseResult(saveResults)

Sets the log entry event’s database operation result fields

Signature

global LogEntryEventBuilder setDatabaseResult(List<Database.SaveResult> saveResults)

Parameters

NameTypeDescription
saveResultsList<Database.SaveResult>The list of Database.SaveResult instances to log

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setDatabaseResult(upsertResults)

Sets the log entry event’s database operation result fields

Signature

global LogEntryEventBuilder setDatabaseResult(List<Database.UpsertResult> upsertResults)

Parameters

NameTypeDescription
upsertResultsList<Database.UpsertResult>The list of Database.UpsertResult instances to log

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setDatabaseResult(undeleteResults)

Sets the log entry event’s database operation result fields

Signature

global LogEntryEventBuilder setDatabaseResult(List<Database.UndeleteResult> undeleteResults)

Parameters

NameTypeDescription
undeleteResultsList<Database.UndeleteResult>The list of Database.UndeleteResult instances to log

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setExceptionDetails(apexException)

Sets the log entry event’s exception fields

Signature

global LogEntryEventBuilder setExceptionDetails(System.Exception apexException)

Parameters

NameTypeDescription
apexExceptionSystem.ExceptionThe instance of an System.Exception to use.

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setField(field, fieldValue)

Sets a field value on the builder’s LogEntryEvent__e record

Signature

global LogEntryEventBuilder setField(Schema.SObjectField field, Object fieldValue)

Parameters

NameTypeDescription
fieldSchema.SObjectFieldThe Schema.SObjectField token of the field to populate
on the builder’s LogEntryEvent__e record
fieldValueObjectThe Object value to populate in the provided field

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setField(fieldToValue)

SUPPRESSWARNINGS

Sets multiple field values on the builder’s LogEntryEvent__e record

Signature

global LogEntryEventBuilder setField(Map<Schema.SObjectField,Object> fieldToValue)

Parameters

NameTypeDescription
fieldToValueMap<Schema.SObjectField,Object>An instance of Map<Schema.SObjectField, Object> containing the
the fields & values to populate on the builder’s LogEntryEvent__e record

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setHttpRequestDetails(request)

Sets the log entry event’s HTTP Request fields

Signature

global LogEntryEventBuilder setHttpRequestDetails(System.HttpRequest request)

Parameters

NameTypeDescription
requestSystem.HttpRequestThe instance of HttpRequest to log

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setHttpRequestDetails(request, headersToLog)

Sets the log entry event’s HTTP Request fields

Signature

global LogEntryEventBuilder setHttpRequestDetails(System.HttpRequest request, List<String> headersToLog)

Parameters

NameTypeDescription
requestSystem.HttpRequestThe instance of HttpRequest to log
headersToLogListAn instance of List<String> containing the header keys to log

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setHttpResponseDetails(response)

Sets the log entry event’s HTTP Response fields

Signature

global LogEntryEventBuilder setHttpResponseDetails(System.HttpResponse response)

Parameters

NameTypeDescription
responseSystem.HttpResponseThe instance of HttpResponse to log

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setMessage(logMessage)

Sets the log entry event’s message field

Signature

global LogEntryEventBuilder setMessage(LogMessage logMessage)

Parameters

NameTypeDescription
logMessageLogMessageThe instance of LogMessage to use to set the entry’s message field

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setMessage(message)

Sets the log entry event’s message field

Signature

global LogEntryEventBuilder setMessage(String message)

Parameters

NameTypeDescription
messageStringThe string to use to set the entry’s message field

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setRecord(recordId)

Sets the log entry event’s record fields

Signature

global LogEntryEventBuilder setRecord(Id recordId)

Parameters

NameTypeDescription
recordIdIdThe ID of the SObject record related to the entry

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setRecord(record)

Sets the log entry event’s record fields

Signature

global LogEntryEventBuilder setRecord(SObject record)

Parameters

NameTypeDescription
recordSObjectThe SObject record related to the entry. The JSON of the record is automatically added to the entry

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setRecord(records)

Sets the log entry event’s record fields

Signature

global LogEntryEventBuilder setRecord(List<SObject> records)

Parameters

NameTypeDescription
recordsListThe list of SObject records related to the entry. The JSON of the list is automatically added to the entry

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setRecord(recordIdToRecord)

Sets the log entry event’s record fields

Signature

global LogEntryEventBuilder setRecord(Map<Id,SObject> recordIdToRecord)

Parameters

NameTypeDescription
recordIdToRecordMap<Id,SObject>The map of SObject records related to the entry. The JSON of the map is automatically added to the entry

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setRecord(recordIds)

Sets the log entry event’s record fields

Signature

global LogEntryEventBuilder setRecord(System.Iterable<Id> recordIds)

Parameters

NameTypeDescription
recordIdsSystem.IterableThe Set of SObject records ids related to the entry. Will be converted to list and the JSON of the list is automatically added to the entry

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setRecordId(recordId)

Deprecated - use setRecord(Id recordId) instead

Signature

global LogEntryEventBuilder setRecordId(Id recordId)

Parameters

NameTypeDescription
recordIdIdThe id of the record to set.

Return Type

LogEntryEventBuilder

An instance of LogEntryEventBuilder with a record associated wit recordId.


setRecordId(record)

Deprecated - use setRecord(SObject record) instead

Signature

global LogEntryEventBuilder setRecordId(SObject record)

Parameters

NameTypeDescription
recordSObjectthe record to set.

Return Type

LogEntryEventBuilder

An instance of LogEntryEventBuilder with the given record.


setRestRequestDetails(request)

Sets the log entry event’s REST Request fields

Signature

global LogEntryEventBuilder setRestRequestDetails(System.RestRequest request)

Parameters

NameTypeDescription
requestSystem.RestRequestThe instance of System.RestRequest to log

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods


setRestResponseDetails(response)

Sets the log entry event’s REST Response fields

Signature

global LogEntryEventBuilder setRestResponseDetails(System.RestResponse response)

Parameters

NameTypeDescription
responseSystem.RestResponseThe instance of System.RestResponse to log

Return Type

LogEntryEventBuilder

The same instance of LogEntryEventBuilder , useful for chaining methods