Skip to content

Masking Log Messages

Johannes Fischer edited this page May 10, 2025 · 5 revisions

RFLIB provides the ability to mask information in the Log Event Messages field to prevent sensitive information from being published. This feature must be activated in the Logger Settings to take effect.

If activated, all log messages will be pre-processed before they are added to the event based on the rules that are configured in a Custom Metadata Type (CMT) record for the CMT called "Masking Rule".

Adding a Masking Rule

It is important to define the correct order for the rules as a rule executed later in the chain may override replacements done by a previous rule. Also note that all log statements posted to the Apex Debug Logs and Browser Console will still contain the sensitive information in plain text. It is therefore recommended to keep those log settings set to NONE if masking is activated.

Masking Additional Details on Application Events

RFLIB also supports masking and safe truncation of the Additional_Details__c field on Application Events (submitted through the Platform Event). To enable this feature, set the global setting App_Event_Masking_Enabled to TRUE (default is FALSE) in the rflib_GlobalSettings Custom Metadata. When enabled, all active masking rules will be applied to the details text, and the result will be truncated to 32,768 characters using the public constant MAX_ADDITIONAL_DETAIL_SIZE defined in rflib_DefaultApplicationEventService. This ensures sensitive data is protected and prevents payloads from exceeding the Big Object size limit.

Clone this wiki locally