SmartSolution

Setup guide

Getting started with LaaS

LaaS can be left enabled continuously and will only write a log when a relevant event occurs. Four steps: install, instrument, configure, read.

2 Use the logger in your code

Set a log description once per execution scenario

Laas.Log.SetDescription(string description);

Log from anywhere in your Apex

Laas.Log.Debug(string component, string message);
Laas.Log.Info(string component, string message);
Laas.Log.Error(string component, string message);
Laas.Log.Warn(string component, string message);
Laas.Log.Exception(string component, Exception ex);

Save before returning

Call save before returning from every web service call, batch, and controller method. Logs that are never saved are logs you do not have.

Laas.Log.Save(true);

3 Configure the logger in your org

Go to Setup → Custom Settings and enable logging by creating an entry at org level, profile level, or user level.

Levels are how you control cost. Enabling at user level for one person reproducing a problem is far cheaper than enabling org-wide.

4 Run your scenario and read the logs

Run the business scenario you want to observe. For testing, the Developer Console is sufficient.

Then open the Log Management app and select View Log on any entry. All logs are available to view, and can be filtered by user, date, log type, and log description.

Stuck on something?

If the framework is not behaving the way this guide describes, tell us — that is useful to know.

Get in touch