Log messages using LWC with lightning/logger
The lightning/logger module offers a convenient way to enhance the observability of your Lightning web components by using the Custom Component Instrumentation API. You can use the log() function to create custom messages and log them from your components to Event Monitoring. It is important to note that lightning/logger can only be used in the Lightning Experience, and is not available in the Salesforce mobile app. To use lightning/logger, you must ensure that Event Monitoring is enabled in your org and that the "Enable Lightning Logger Events" toggle is set to On. The lightning/logger module has only one method, log(). This isn't supported for Aura components According to Salesforce documentation, this change is only available for customers who have purchased Salesforce Shield or Salesforce Event Monitoring add-on subscriptions. Enable Event Monitoring Settings Here's an example from Salesforce In JavaScript, import the log from lightning/logger and use it in the h...