The most robust observability solution for Salesforce experts. Built 100% natively on the platform, and designed to work seamlessly with Apex, Lightning Components, Flow, OmniStudio, and integrations.
Builder class that generates each LogEntryEvent__e
record
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 |
aggregateQueriesMax
→ Integer
asyncCallsMax
→ Integer
calloutsMax
→ Integer
cpuTimeMax
→ Integer
dmlRowsMax
→ Integer
dmlStatementsMax
→ Integer
emailInvocationsMax
→ Integer
futureCallsMax
→ Integer
heapSizeMax
→ Integer
mobilePushApexCallsMax
→ Integer
publishImmediateDmlStatementsMax
→ Integer
queueableJobsMax
→ Integer
soqlQueriesMax
→ Integer
soqlQueryLocatorRowsMax
→ Integer
soqlQueryRowsMax
→ Integer
soslSearchesMax
→ Integer
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.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.EmptyRecycleBinResult emptyRecycleBinResult)
→ LogEntryEventBuilder
Sets the log entry event's database operation result fields
Param | Description |
---|---|
emptyRecycleBinResult |
The instance of Database.EmptyRecycleBinResult to log |
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(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.EmptyRecycleBinResult> emptyRecycleBinResults)
→ LogEntryEventBuilder
Sets the log entry event's database operation result fields
Param | Description |
---|---|
emptyRecycleBinResults |
The list of Database.EmptyRecycleBinResult s 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(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
setField(Schema.SObjectField field, Object fieldValue)
→ LogEntryEventBuilder
Sets a field value on the builder's LogEntryEvent__e
record
Param | Description |
---|---|
field |
The Schema.SObjectField token of the field to populate |
fieldValue |
The Object value to populate in the provided field |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setField(Map<Schema.SObjectField, Object> fieldToValue)
→ LogEntryEventBuilder
Sets multiple field values on the builder's LogEntryEvent__e
record
Param | Description |
---|---|
fieldToValue |
An instance of Map<Schema.SObjectField, Object> containing the |
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
setHttpRequestDetails(System.HttpRequest request, List<String> headersToLog)
→ LogEntryEventBuilder
Sets the log entry event's HTTP Request fields
Param | Description |
---|---|
request |
The instance of HttpRequest to log |
headersToLog |
An instance of List<String> containing the header keys 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
setLoggingContext(LoggingContext loggingContext)
→ void
This is only intended to be used internally by Nebula Logger, and is subject to change.
Param | Description |
---|---|
loggingContext |
Variables specific to the current Logger state |
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
setRecord(System.Iterable<Id> recordsIds)
→ LogEntryEventBuilder
Sets the log entry event's record fields
Param | Description |
---|---|
recordsIds |
The 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 |
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 System.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 System.RestResponse to log |
Type
LogEntryEventBuilder
Description
The same instance of LogEntryEventBuilder
, useful for chaining methods
setTimestamp(Datetime timestamp)
→ LogEntryEventBuilder
This is only intended to be used internally by Nebula Logger, and is subject to change.
Param | Description |
---|---|
timestamp |
Datetime instance to set timestamp fields on this.logEntryEvent |
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.
LoggingContext(String loggerVersionNumber,String organizationApiVersion,String organizationDomainUrl,String requestId,System.Quiddity systemMode,String transactionId)
currentEntryScenario
→ String
entryNumber
→ Integer
loggerVersionNumber
→ String
organizationApiVersion
→ String
organizationDomainUrl
→ String
requestId
→ String
systemMode
→ System.Quiddity
transactionId
→ String
userLoggingLevel
→ System.LoggingLevel