The most robust logger for Salesforce. Works with Apex, Lightning Components, Flow, Process Builder & Integrations. Designed for Salesforce admins, developers & architects.
Builder class that generates each LogEntryEvent__e
record
LogEntryEventBuilder(LoggerSettings__c userSettings, System.LoggingLevel entryLoggingLevel, Boolean shouldSave, Set<String> ignoredOrigins)
Deprecated
- Formally used by Logger
to instantiate a new instance of LogEntryEventBuilder
Param | Description |
---|---|
userSettings |
The instance of LoggerSettings__c for the current to use to control any feature flags |
entryLoggingLevel |
The LoggingLevel value to use for the log entry |
shouldSave |
Indicates if the builder's instance of LogEntryEvent__e should be saved |
ignoredOrigins |
A Set<String> of the names of any Apex classes that should be ignored when parsing the entry's origin |
LogEntryEventBuilder(LoggerSettings__c userSettings, System.LoggingLevel entryLoggingLevel, Boolean shouldSave)
Used by Logger
to instantiate a new instance of LogEntryEventBuilder
Param | Description |
---|---|
userSettings |
The instance of LoggerSettings__c for the current to use to control any feature flags |
entryLoggingLevel |
The LoggingLevel value to use for the log entry |
shouldSave |
Indicates if the builder's instance of LogEntryEvent__e should be saved |
addTag(String tag)
→ LogEntryEventBuilder
Appends the tag to the existing list of tags
Param | Description |
---|---|
tag |
The string to use as a tag for the current entry |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
addTags(List<String> tags)
→ LogEntryEventBuilder
Appends the tag to the existing list of tags
Param | Description |
---|---|
tags |
The list of strings to use as tags for the current entry |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
getLogEntryEvent()
→ LogEntryEvent__e
Returns the LogEntryEvent__e
record for this instance of LogEntryEventBuilder
Type
LogEntryEvent__e
Description
The LogEntryEvent__e
record
parseStackTrace(String stackTraceString)
→ LogEntryEventBuilder
Parses the provided stack trace and sets the log entry's origin & stack trace fields
Param | Description |
---|---|
stackTraceString |
The Apex stack trace string to parse |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setDatabaseResult(Database.LeadConvertResult leadConvertResult)
→ LogEntryEventBuilder
Sets the log entry event's database operation result fields
Param | Description |
---|---|
leadConvertResult |
The instance of Database.LeadConvertResult to log |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setDatabaseResult(List<Database.LeadConvertResult> leadConvertResults)
→ LogEntryEventBuilder
Sets the log entry event's database operation result fields
Param | Description |
---|---|
leadConvertResults |
The list of Database.LeadConvertResult s to log |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setDatabaseResult(Database.DeleteResult deleteResult)
→ LogEntryEventBuilder
Sets the log entry event's database operation result fields
Param | Description |
---|---|
deleteResult |
The instance of Database.DeleteResult to log |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setDatabaseResult(Database.MergeResult mergeResult)
→ LogEntryEventBuilder
Sets the log entry event's database operation result fields
Param | Description |
---|---|
mergeResult |
The instance of Database.MergeResult to log |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setDatabaseResult(Database.SaveResult saveResult)
→ LogEntryEventBuilder
Sets the log entry event's database operation result fields
Param | Description |
---|---|
saveResult |
The instance of Database.SaveResult to log |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setDatabaseResult(Database.UpsertResult upsertResult)
→ LogEntryEventBuilder
Sets the log entry event's database operation result fields
Param | Description |
---|---|
upsertResult |
The instance of Database.UpsertResult to log |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setDatabaseResult(Database.UndeleteResult undeleteResult)
→ LogEntryEventBuilder
Sets the log entry event's database operation result fields
Param | Description |
---|---|
undeleteResult |
The instance of Database.UndeleteResult to log |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setDatabaseResult(List<Database.DeleteResult> deleteResults)
→ LogEntryEventBuilder
Sets the log entry event's database operation result fields
Param | Description |
---|---|
deleteResults |
The list of Database.DeleteResult instances to log |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setDatabaseResult(List<Database.MergeResult> mergeResults)
→ LogEntryEventBuilder
Sets the log entry event's database operation result fields
Param | Description |
---|---|
mergeResults |
The list of Database.MergeResult instances to log |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setDatabaseResult(List<Database.SaveResult> saveResults)
→ LogEntryEventBuilder
Sets the log entry event's database operation result fields
Param | Description |
---|---|
saveResults |
The list of Database.SaveResult instances to log |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setDatabaseResult(List<Database.UpsertResult> upsertResults)
→ LogEntryEventBuilder
Sets the log entry event's database operation result fields
Param | Description |
---|---|
upsertResults |
The list of Database.UpsertResult instances to log |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setDatabaseResult(List<Database.UndeleteResult> undeleteResults)
→ LogEntryEventBuilder
Sets the log entry event's database operation result fields
Param | Description |
---|---|
undeleteResults |
The list of Database.UndeleteResult instances to log |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setExceptionDetails(System.Exception apexException)
→ LogEntryEventBuilder
Sets the log entry event's exception fields
Param | Description |
---|---|
apexException |
The instance of an System.Exception to use. |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setHttpRequestDetails(System.HttpRequest request)
→ LogEntryEventBuilder
Sets the log entry event's HTTP Request fields
Param | Description |
---|---|
request |
The instance of HttpRequest to log |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setHttpResponseDetails(System.HttpResponse response)
→ LogEntryEventBuilder
Sets the log entry event's HTTP Response fields
Param | Description |
---|---|
response |
The instance of HttpResponse to log |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setMessage(LogMessage logMessage)
→ LogEntryEventBuilder
Sets the log entry event's message field
Param | Description |
---|---|
logMessage |
The instance of LogMessage to use to set the entry's message field |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setMessage(String message)
→ LogEntryEventBuilder
Sets the log entry event's message field
Param | Description |
---|---|
message |
The string to use to set the entry's message field |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setRecord(Id recordId)
→ LogEntryEventBuilder
Sets the log entry event's record fields
Param | Description |
---|---|
recordId |
The ID of the SObject record related to the entry |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setRecord(SObject record)
→ LogEntryEventBuilder
Sets the log entry event's record fields
Param | Description |
---|---|
record |
The SObject record related to the entry. The JSON of the record is automatically added to the entry |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setRecord(List<SObject> records)
→ LogEntryEventBuilder
Sets the log entry event's record fields
Param | Description |
---|---|
records |
The list of SObject records related to the entry. The JSON of the list is automatically added to the entry |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setRecord(Map<Id, SObject> recordIdToRecord)
→ LogEntryEventBuilder
Sets the log entry event's record fields
Param | Description |
---|---|
recordIdToRecord |
The map of SObject records related to the entry. The JSON of the map is automatically added to the entry |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setRecordId(Id recordId)
→ LogEntryEventBuilder
Deprecated - use setRecord(Id recordId)
instead
Param | Description |
---|---|
recordId |
The id of the record to set. |
Type
LogEntryEventBuilder
Description
An instance of LogEntryEventBuilder with a record associated wit recordId.
setRecordId(SObject record)
→ LogEntryEventBuilder
Deprecated - use setRecord(SObject record)
instead
Param | Description |
---|---|
record |
the record to set. |
Type
LogEntryEventBuilder
Description
An instance of LogEntryEventBuilder with the given record.
setRestRequestDetails(System.RestRequest request)
→ LogEntryEventBuilder
Sets the log entry event's REST Request fields
Param | Description |
---|---|
request |
The instance of RestRequest to log |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setRestResponseDetails(System.RestResponse response)
→ LogEntryEventBuilder
Sets the log entry event's REST Response fields
Param | Description |
---|---|
response |
The instance of RestResponse to log |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setTopics(List<String> tags)
→ LogEntryEventBuilder
Deprecated - use addTags(List<String> tags)
instead. This method will be removed in a future release
Param | Description |
---|---|
tags |
A list of tags |
Type
LogEntryEventBuilder
Description
An instance of LogEntryEventBuilder with the given topics / tags.
shouldSave()
→ Boolean
Determines if this instance of LogEntryEventBuilder
should be saved the next time that Logger.saveLog()
is called
Type
Boolean
Description
A boolean set to true if the log entries should be saved.