Skip to main content

Overview

ErrorLogger is a production-safe Apex utility class included in the Zentien package. It publishes errors as ErrorEvent__e Platform Events, which Zentien receives and stores in real time. Design principles:
  • Never throws — all methods are wrapped in try/catch. A failure to log will never break your calling code.
  • No callout limits consumed — Platform Events use a separate publish limit (not the callout limit)
  • Synchronous publish — errors appear in Zentien within seconds

Methods

log(Exception e, String className, String methodName)

Logs an exception with ERROR severity.

log(Exception e, String className, String methodName, String severity)

Logs an exception with a specified severity.

log(Exception e, String className, String methodName, String severity, String recordId)

Logs an exception with severity and a related Salesforce record ID for additional context.

ErrorEvent__e fields

The Platform Event published by ErrorLogger contains the following fields: