NebulaLogger

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.

View the Project on GitHub jongpie/NebulaLogger

ComponentLogger class

Controller class used by the lightning web component logger

Logger

LogEntryEventBuilder


Methods

getSettings()ComponentLoggerSettings

Provides data to the frontend about LoggerSettings__c & server-supported logging details

Return

Type

ComponentLoggerSettings

Description

return The instance of ComponentLoggerSettings for the current user

saveComponentLogEntries(List<ComponentLogEntry> componentLogEntries, String saveMethodName)String

saveComponentLogEntries Saves log entries created via lwc or aura components

Parameters
Param Description
componentLogEntries The list of ComponentLogEntry objects to save via Logger
saveMethodName String name of the instance of Logger.SaveMethod to use when saving.
Return

Type

String

Description

return The transaction ID (based on Logger.getTransactionId())


Inner Classes

ComponentLogger.ComponentBrowserContext class

A DTO object used to log details about the user's browser


Properties
addressString

The URL displayed in the user's browser

formFactorString

The form factor of the user's browser

languageString

The language set in the user's browser

screenResolutionString

The resolution of the user's device

userAgentString

The user agent of the user's browser

windowResolutionString

The resolution of the user's browser window


ComponentLogger.ComponentError class

A DTO object used to log details about a JavaScript error


Properties
messageString

The error's message

stackString

DEPRECATED This property is no longer used, and will be removed in a future release. The error's stack trace string

stackTraceComponentStackTrace

Contains details about the origin of the error

typeString

The type of JavaScript error


ComponentLogger.ComponentLogEntry class

A DTO object used to create log entries for lightning components


Properties
browserComponentBrowserContext

Context about the user's browser, automatically captured by Nebula Logger

errorComponentError

(Optional) A JavaScript Error to log

fieldToValueMap<String, Object>

(Optional) A map containing key-value pairs of fields to set on LogEntryEvent__e

loggingLevelString

The name of the LoggingLevel enum value

messageString

The value to use as the log entry's message

originStackTraceComponentStackTrace

Contains details about the origin of the component log entry

recordSObject

(Optional) The record to relate to the log entry - the record's JSON is also stored

recordIdId

(Optional) The record ID to relate to the log entry

scenarioString

Optionally specify the name to use for the current transaction's scenario

stackString

DEPRECATED This property is no longer used, and will be removed in a future release. The JavaScript stack trace from when the log entry was created

tagsList<String>

(Optional) A list of tags to associate with the log entry

timestampDatetime

The datetime that the log entry was created in the lightning component


ComponentLogger.ComponentLoggerSettings class

A DTO object used for passing LoggerSettings__c details to lightning components


Properties
defaultSaveMethodNameString

Indicates the save method that will be used by default if no other save method is specified, based on LoggerSettings__c.DefaultSaveMethod__c

isConsoleLoggingEnabledBoolean

Indicates if logging via the browser's console.log() is enabled for the current user, based on LoggerSettings__c.IsJavaScriptConsoleLoggingEnabled__c

isEnabledBoolean

Indicates if logging is enabled for the current user, based on LoggerSettings__c.IsEnabled__c

isLightningLoggerEnabledBoolean

Indicates if logging via the standard LWC lightning-logger is enabled for the current user, based on LoggerSettings__c.IsJavaScriptLightningLoggerEnabled__c

supportedLoggingLevelsMap<String, Integer>

A map of the supported LoggingLevel enum values

userLoggingLevelComponentLoggingLevel

The configured LoggingLevel for the current user, based on LoggerSettings__c.LoggingLevel__c


ComponentLogger.ComponentLoggingLevel class

A DTO object used for passing LoggingLevel details to lightning components


Properties
nameString

The name of the LoggingLevel enum value

ordinalInteger

The ordinal of the LoggingLevel enum value


ComponentLogger.ComponentStackTrace class

A DTO object used to log details about the origin of a JavaScript log entry


Properties
componentNameString

The component that generated the log entry

functionNameString

The component's function that generated the log entry

metadataTypeString

The metadata type of the component that generated the log entry Possible values are AuraDefinitionBundle and LightningComponentBundle

parsedStackTraceStringString

The parsed stack trace used to determine the log entry origin