Getting Started with Pharos Integration - j-fischer/rflib GitHub Wiki
Overview
The Pharos integration provides a seamless way to capture and forward RFLIB Log Events to Pharos log records. This allows for advanced log management and analysis utilizing the Pharos platform.
This integration is built on top of the RFLIB logging framework and extends it with:
- Creation of Pharos log records triggered from RFLIB log events
- Configurable post-processing settings for Pharos logs via Salesforce Custom Settings
- Log Level based configuration for triggering the Pharos integration
- Uses RFLIB's field mapping feature to set values in Pharos Log record, which means that new fields from Pharos can be adopted without installing a new version of RFLIB
Pharos Installation
This integration has been tested with Pharos version 1.45 or higher. While it may work with earlier versions, we recommend using at least this version to ensure all features function correctly.
After installing Pharos, make sure to:
- Complete the Setup Instructions for your Salesforce Org.
- Complete the Triton Setup Instructions.
See the Pharos Support Portal for more information.
RFLIB-PHAROS Setup Instructions
There is no direct dependency between the RFLIB package and Pharos packages. However, for the integration to work, the Pharos base package must be installed in the Salesforce org.
- Installation
- Install the RFLIB package version 10.0 or later.
- Install the RFLIB-PHAROS package version 1.0 or later.
- Optional: Run
new rflib_PharosPostInstallHandler().createDefaultSettings();
in anonymous Apex either in the Salesforce IDE or using the SFDX CLI.
IMPORTANT NOTE: Salesforce does not support post-install scripts for unlocked packages. When RFLIB processes the first event for Pharos, it will create the default values for the Pharos Post Processing Settings.
-
Configure Logging Level
- Navigate to
rflib_Logger_Settings__c
custom settings. - Set
Pharos_Log_Level__c
to an appropriate level to enable the integration. Acceptable values areWARN
,ERROR
, orFATAL
. - Set to NONE to disable integration.
- Navigate to
-
Configure Post-Processing Settings
- Go to the
rflib_Pharos_Post_Processing_Setting__c
custom settings. - Enable or disable post-processing features by setting boolean values (
true/false
). - Changes here impact all future logs sent to Pharos.
- Go to the
-
Usage
- Use RFLIB for logging as usual.
Error Handling and Logging
- The integration uses RFLIB's logging framework to report its own internal processing.
- Critical errors during Pharos log record creation are caught and logged via rflib_Logger to the Salesforce Debug Logs only to avoid recursive logging loops.
Screenshots
Pharos Setup After Completion
Logger Settings Screen
Default Post-Processing Settings After Installation
Pharos Field Mappings
Troubleshooting
- Ensure the Pharos managed package is installed so that the
pharos__Log__c
andpharos__Log_Event__e
objects exist. - If no Pharos log events are being created, verify the
Pharos_Log_Level__c
is not set to NONE. - Check debug logs for errors for the System Automation user.
- Confirm that post-processing settings are correctly configured in the custom settings.
Further Information
For questions or troubleshooting beyond this manual, please consult the source code for the following classes:
rflib_PharosLogAction
rflib_PharosPostInstallHandler
rflib_PharosPostProcessingBuilder