Show TOC

Creating Audit Log EntriesLocate this document in the navigation structure

Use

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

Prerequisites
  • 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

    Note

    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.
Features

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

 

XI Message Interfaces

Write the log entry as is shown in the following example:

Note

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

Caution

To avoid unnecessary audit log entries, do not use flushAuditLogEntries() for synchronous messages.

Checking the Messages in the Message Monitor

  • 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 serviceXPI AF Messaging.System, set the following property:

    Messaging.syncMessageRemover.removeBody = false

    More information: Properties for Service XPI AF Messaging System

    Caution

    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.