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.
LogEntryBuilder
Sets the log entry event's message field
LogEntryBuilder
Sets the log entry event's record fields
LogEntryBuilder
Sets the log entry event's record fields
LogEntryBuilder
Sets the log entry event's scenario field
LogEntryBuilder
Deprecated - use setExceptionDetails(exception)
instead
The name of this method is very similar to the logger function logger.error(),
resulting in confusion when used together:
logger.error('Unexpected error').setError(someErrorObject);
The new setExceptionDetails(exception)
function provides the exact same functionality,
but aligns with the Apex builder's method name, and helps reduce the confusion with logger.error()
LogEntryBuilder
Sets the log entry event's exception fields
LogEntryBuilder
Sets multiple field values on the builder's LogEntryEvent__e
record
LogEntryBuilder
Parses the provided error's stack trace and sets the log entry's origin & stack trace fields
LogEntryBuilder
Appends the tag to the existing list of tags
LogEntryBuilder
Appends the tag to the existing list of tags
ComponentLogEntry
Returns the object used to save log entry data
LogEntryBuilder
Sets the log entry event’s message field
Kind: global function
Returns: LogEntryBuilder
- The same instance of LogEntryBuilder
, useful for chaining methods
Param | Type | Description |
---|---|---|
message | String |
The string to use to set the entry’s message field |
LogEntryBuilder
Sets the log entry event’s record fields
Kind: global function
Returns: LogEntryBuilder
- The same instance of LogEntryBuilder
, useful for chaining methods
Param | Type | Description |
---|---|---|
recordId | String |
The ID of the SObject record related to the entry |
LogEntryBuilder
Sets the log entry event’s record fields
Kind: global function
Returns: LogEntryBuilder
- The same instance of LogEntryBuilder
, useful for chaining methods
Param | Type | Description |
---|---|---|
record | Object |
The SObject record related to the entry. The JSON of the record is automatically added to the entry |
LogEntryBuilder
Sets the log entry event’s scenario field
Kind: global function
Returns: LogEntryBuilder
- The same instance of LogEntryBuilder
, useful for chaining methods
Param | Type | Description |
---|---|---|
scenario | String |
The string to use to set the entry’s scenario field |
LogEntryBuilder
Deprecated - use setExceptionDetails(exception)
instead
The name of this method is very similar to the logger function logger.error(),
resulting in confusion when used together:
logger.error('Unexpected error').setError(someErrorObject);
The new setExceptionDetails(exception)
function provides the exact same functionality,
but aligns with the Apex builder’s method name, and helps reduce the confusion with logger.error()
Kind: global function
Returns: LogEntryBuilder
- The same instance of LogEntryBuilder
, useful for chaining methods
Param | Type | Description |
---|---|---|
error | Error |
The instance of a JavaScript Error object to use, or an Apex HTTP error to use |
LogEntryBuilder
Sets the log entry event’s exception fields
Kind: global function
Returns: LogEntryBuilder
- The same instance of LogEntryBuilder
, useful for chaining methods
Param | Type | Description |
---|---|---|
exception | Error |
The instance of a JavaScript Error object to use, or an Apex HTTP error to use |
LogEntryBuilder
Sets multiple field values on the builder’s LogEntryEvent__e
record
Kind: global function
Returns: LogEntryBuilder
- The same instance of LogEntryBuilder
, useful for chaining methods
Param | Type | Description |
---|---|---|
fieldToValue | Object |
An object containing the custom field name as a key, with the corresponding value to store. Example: {"SomeField__c": "some value", "AnotherField__c": "another value"} |
LogEntryBuilder
Parses the provided error’s stack trace and sets the log entry’s origin & stack trace fields
Kind: global function
Returns: LogEntryBuilder
- The same instance of LogEntryBuilder
, useful for chaining methods
Param | Type | Description |
---|---|---|
originStackTraceError | Error |
The instance of a JavaScript Error object with a stack trace to parse |
LogEntryBuilder
Appends the tag to the existing list of tags
Kind: global function
Returns: LogEntryBuilder
- The same instance of LogEntryBuilder
, useful for chaining methods
Param | Type | Description |
---|---|---|
tag | String |
The string to add as a tag for the current log entry |
LogEntryBuilder
Appends the tag to the existing list of tags
Kind: global function
Returns: LogEntryBuilder
- The same instance of LogEntryBuilder
, useful for chaining methods
Param | Type | Description |
---|---|---|
tags | Array.<String> |
The list of strings to add as tags for the current entry |
ComponentLogEntry
Returns the object used to save log entry data
Kind: global function
Returns: ComponentLogEntry
- An instance of ComponentLogEntry
that matches the Apex class ComponentLogger.ComponentLogEntry