-
Notifications
You must be signed in to change notification settings - Fork 0
The AsyncActionLogger.Adapter Interface
The AsyncActionLogger.Adapter interface provides a way to connect your preferred logging framework to consume internal logs generated by the framework.
The framework determines which logging adapter to use based on the AsyncActionGlobalSetting__mdt.LoggerPlugin__c field. If no custom adapter is configured or if the specified adapter is invalid, the framework uses the built-in DefaultLogger that writes to System.debug.
Important: The framework performs asynchronous runs as the Automated Process user. To see these debug logs, enable a trace flag on this system user.
Logs a message at the specified level.
Saves/commits any pending log entries. Implementation depends on the logging adapter.
This example routes internal framework logs to NebulaLogger:
global class NebulaLoggerAdapter implements AsyncActionLogger.Adapter {
global void log(System.LoggingLevel level, Object logMessage) {
Logger.newEntry(level, logMessage?.toString());
}
global void save() {
Logger.saveLog();
}
}