Creating Audit Log Entries
You use the audit log to write and persist log entries for a message. These entries indicate how an actual message instance was processed in the Adapter Framework and on the Integration Server.
Interface Overview
Characteristic |
Value |
Name |
Adapter Framework audit log |
Purpose |
Writes entries to the AF message log, checks time of persistence. |
Type |
AS Java interface in facade com.sap.aii.af.ifc.facade |
Technical name |
com.sap.engine.interfaces.messaging.api.auditlog |
Certification |
Optional |
Syntax |
Javadoc (.\index.html) package com.sap.engine.interfaces.messaging.api.auditlog |
● Before audit log entries can be written, you must gain access to an object that implements AuditAccess.
To do this, use the object PublicAPIAccess. getAuditAccess() gives you an AuditAccess object.
More information: XI Message Interfaces

Open SPIManagedConnectionFactory.java and search for the character string CS_AUDITACCESS.
● To link the audit log entry to a message, you must instantiate a MessageKey object when writing the audit log entry.
Methods for Audit Monitoring
Class/interface |
Method Name |
Method |
AuditAccess |
addAuditLogEntry |
Use the AuditMessageKey |
AuditAccess |
flushAuditLogEntries |
Writes audit log entries to the database. All audit log entries are collected in the memory before the method is called. |
AuditLogStatus |
|
Valid status entries |
Message Key |
|
Write the log entry as is shown in the following example:

Open SPIManagedConnectionFactory.java and search for the character string CS_TRAUD.

To avoid unnecessary audit log entries, do not use flushAuditLogEntries() for synchronous messages.
● To be able to display the payload of a synchronous message in the message monitor, you can convert a service property for your adapter test.
● In the service XPI AF Messaging.System, set the following property:
Messaging.syncMessageRemover.removeBody = false
More
information:
Properties for Service
XPI AF Messaging System

Only change this parameter in a test system.
In a productive system, this setting can lead to OutOfMemory exceptions in AS Java if numerous large, synchronous messages use up the main memory.