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.
LogEntryBuilderSets the log entry event's message field
LogEntryBuilderSets the log entry event's record fields
LogEntryBuilderSets the log entry event's record fields
LogEntryBuilderSets the log entry event's scenario field
LogEntryBuilderDeprecated - 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()
LogEntryBuilderSets the log entry event's exception fields
LogEntryBuilderSets multiple field values on the builder's LogEntryEvent__e record
LogEntryBuilderParses the provided error's stack trace and sets the log entry's origin & stack trace fields
LogEntryBuilderAppends the tag to the existing list of tags
LogEntryBuilderAppends the tag to the existing list of tags
ComponentLogEntryReturns the object used to save log entry data
LogEntryBuilderSets 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 |
LogEntryBuilderSets 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 |
LogEntryBuilderSets 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 |
LogEntryBuilderSets 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 |
LogEntryBuilderDeprecated - 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 |
LogEntryBuilderSets 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 |
LogEntryBuilderSets 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"} |
LogEntryBuilderParses 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 |
LogEntryBuilderAppends 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 |
LogEntryBuilderAppends 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 |
ComponentLogEntryReturns the object used to save log entry data
Kind: global function
Returns: ComponentLogEntry - An instance of ComponentLogEntry that matches the Apex class ComponentLogger.ComponentLogEntry