Skip to content

The AsyncActionLogger.Adapter Interface

GitHub Action edited this page Sep 25, 2025 · 2 revisions

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.

Methods

log(System.LoggingLevel level, Object logMessage)

Logs a message at the specified level.

save()

Saves/commits any pending log entries. Implementation depends on the logging adapter.

Example

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();
	}
}

Clone this wiki locally