cancel
Showing results for 
Search instead for 
Did you mean: 

AuditLogManager - java

maciej_jarecki
Contributor
0 Kudos

Hi All,

In documentation of Interface AuditAccess in package com.sap.engine.interfaces.messaging.api.auditlog i found that it is possible to read AuditLog for messagekey using AuditLogManager. But i cannot find AuditLogManager ? Does someone know where i can found it or how to read auditlog for messagekey ?

BR

Maciej

Accepted Solutions (0)

Answers (1)

Answers (1)

vadimklimov
Active Contributor
0 Kudos

Hi Maciej,

Please consider checking method getAuditEntryList() of AuditLogManager implementing class (com.sap.engine.messaging.impl.util.auditlog.AuditLogManager). This can be found in library com.sap.aii.af.ms.svc_api.jar (<bin>/services/com.sap.aii.af.ms.svc/lib/). Given a message key, it should return an array of corresponding audit log entries.

Signature of the method is as following:

public ArrayList<AuditLogEntry> getAuditEntryList(MessageKey msgKey) throws SQLException

Regards,

Vadim

maciej_jarecki
Contributor
0 Kudos

Hi Vadim,

Thanks for quick replay. i didn't mention that i use pi 7.0. Is this function is available in this release ?

BR

Maciej

vadimklimov
Active Contributor
0 Kudos

Hi Maciej,

Sorry for late reply.

In 7.0, AuditLogManager is accessible, but you should take a look into AF library to find this class: aii_af_svc.jar

(<bin>/services/com.sap.aii.af.svc/).

Regards,

Vadim

Former Member
0 Kudos

Hello,

I have a requirement where from a message mapping I need to find out the Audit log for a given message.

My Source payload will contain a message ID:

<Record>

<Data>

<MSGID>4F0C5BCC65150FB0E1008000AC1E11AD</MSGID>

<MSGDIR>OUTBOUND</MSGDIR>

</Data>

</Record>

Target will provide the Audit log entries like this.

<AuditAccess>

<message></messsage>

<AuditEntry>

<line> </line>

<line> </line>

<line> </line>

<line> </line>

<line> </line>

...

</AuditEntry>

</AuditAccess>

For this we wrote a UDF where we are trying to access. Here is my Java code:

import com.sap.engine.messaging.impl.util.auditlog.AuditLogManager;

import com.sap.engine.interfaces.messaging.api.*;

import java.util.*;

public class RWBTest {

public static void main(String[] args) {

String msgID = "12345678";

MessageDirection msgDirection = MessageDirection.valueOf("OUTBOUND");

ArrayList al = new ArrayList();

MessageKey msg = new MessageKey(msgID,msgDirection);

AuditLogManager am = AuditLogManager.getInstance();

try {

al = am.getAuditEntryList(msg);

} catch (Exception e) {

// TODO: handle exception

}

String ret = al.toString();

}

}

The issue is I am not able to instantiate AuditLogManager and getting a NULL pointer exception.

I could not find any JavaDoc for AuditLogManager class.

Anyhelp/document on AuditLogManager class would be much appreciated.

Thanks in advance !!!

maciej_jarecki
Contributor
0 Kudos

HI

Did you solve this issue ?

BR

M.

vadimklimov
Active Contributor
0 Kudos

Hello Shibaji,

It isn't clear for me what is the intention to use AuditLogManager in UDF (message mapping)? For mappings, the standard way to go is to utilize AbstractTrace.addInfo() in order to create trace entries. For example:

com.sap.aii.mapping.api.AbstractTransformation.getTrace().addInfo("Sample text of the trace entry");

Next, is there any reason to pass technical information like message ID, direction in the payload? In general, payload should contain integrated application data whereas message technical data like message ID can be retrieved from mapping runtime constants. On SAP Help, you can see all mapping runtime constants that can be used as well as proposal on their usage:

http://help.sap.com/saphelp_nwpi711/helpdata/en/b3/9a2aeb24dc4ab6b1855c99157529e4/frameset.htm

Regards,

Vadim

Former Member
0 Kudos

Hello,

I would need the same functionality - check status of some message from another relation if I know MessageID. So in this case I need it also use this feature in UDF.

Could you help me and advise how to get AuditEntryLog with information about processing message in UDF if I know MessageID of this relation, please?

Thanks Michal

(I'm using PI 7.11)