Administrator Guide (Package Version 1.2.0)

You are here:
  • Main
  • sLog
  • Administrator Guide (Package Version 1.2.0)
< All Topics

App’s installation is prerequisite for its use. If you have not installed and configured sLog general settings, please refer to the installation guide.

Introduction

With sLog you can log standard automation errors as well as Apex errors. Just by installing the app, you will immediately log errors coming from Visual flows and Process builders. It’s also possible to log Apex errors by adding a quick configuration in the Apex code.

Below, the various automated processes supported by sLog and their configuration if necessary.

1. Standard Automation Processes

After installation and configuration of the application, all logs on the processes below will be created automatically :

  • Visual Flow Error
  • Process Builder Error
  • Platform Status Alert

Visual Flow Errors

Errors will generate a persistant log with the “FlowException” record type:

Process Builder Errors

When a process builder failed, the same log will be created with the record type “ProcessBuilderException” :

Platform Status Alert

Slog will also generate logs of all alerts that occur during the processing of a user request or service job execution.

2. APEX Processes

To log APEX processes, you have to perform a quick configuration on your apex code.

Apex Batch Error

sLog also allow to log easily any batch job using the batch event platform.

On the declaration of your batches add :

Plain Text

Example:

Plain Text

Now when a batch will fail, a log will be created with the record type “BatchException”:

Exception error

Exceptions are used in try/catch parts of code. If you want to generate a log in any of your try/catch, you can use the following signature:

Plain Text
Plain Text

This will create a Log record with the “TryCatchException” RecordType.

The default log level is « ERROR » but you can also define it using the following method :

Plain Text

Example:

Plain Text

Advice : if you have multiple logs for one transaction:

If you have multiples logs for a given transaction you wont create logs one by one but rather all at the same time.

For that we have three other methods you can use:

Plain Text
Plain Text
Plain Text
  • The isBulk parameter allow to delay the creation of a single log and at the end of the transaction
  • You have to use the writeBulk() method to create all the logs at once.

Example:

Plain Text

So if you are in a for/while loop, be sure to use the method with the “isBulk” parameter to true.

Http Request Error

You can use sLog to log any of your http request using the following methods:

Plain Text
Plain Text
Plain Text
Plain Text

You just have to put the request and the response (both are not mandatory but it’s best to have both) in the write method and it will be parsed correctly and create a log record with “HttpRequest” RecordType.

The log created will have :
– All the parameters of the sent request (exept the header because it can contain sensitive information)
– All the parameters of the response, exept the header.

The default log level is “DEBUG” and can be overridden. The isBulk parameter is used the same as for the Exceptions, just don’t forget to use the method at the end of the loop to write all the log at once.

Plain Text

Example:

Plain Text

Add informations on your Log records

In addition if you need to add some informations about the process/class/method, you can use one of the four other method below :

Plain Text
Plain Text
Plain Text
Plain Text

Those methods works exactly the same as the four firsts methods they just allow you to precise some informations on your log.

Applicative Trace

The trace can be used to monitor if your code went to a certain point at certain time, and confirm it went through a defined process. Anywhere else in your org you can use the following methods to create a trace log with custom messages :

Attention Point

As the log will perform a DML be carefull to not put them before a callout or you will have an error of the type : “You have uncomited work pending please commit before callout”. You still can log before the callout just use the method with “isbulk” to true and use the writeBulk() method AFTER the callouts.

Plain Text
Plain Text
Plain Text
Plain Text

A log will be created with “Trace” RecordType and the default log level is “INFO”.

DataBase

Another type of log we provide is the database log. This is used anytime you can use a database.saveResult. You can use it with an array of saveResult or a single saveResult. It will log the errors generated by the DML operation.

Attention Point

The datadase method must be used with the allOrNone boolean to false in order to not generate an exception and be logged with the saveResult standard error. Else if any error happens you will have an exception that you can log with the exception method.

Methods are the following:

Plain Text
Plain Text
Plain Text
Plain Text
Plain Text
Plain Text
Plain Text
Plain Text

Example:

Plain Text

If any of your Database action is inside a loop for any reason you will have to use the method with the “isBulk” parameter to true and use the method at the end of the loop to write all the log at once.

Plain Text

3. Reporting

Out of the box Reports are available and others can be made to monitor the processes you want to have a closer control on.
SLog comes with a simple dashboard with integrated reports that count the différents types of logs. You can exclude any log from one of our report by checking the « Archived » Checkbox on the Log record.

4. Watch our video to see How does it works

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[EN]
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[FR]

xxxiWebSite

iiiReturn to AppExchange
xiiixOur Apps