Online Tutorials & Training Materials | STechies.com
Register Login

Creating an XI Adapter Framework trace file

|| || 0

Creating an XI Adapter Framework trace file
Stechies

For the Java components for SAP XI/PI 3.0, 7.0, 7.1, or 7.3 , you want to create a trace file with trace level ERROR, WARNING, DEBUG, or another trace level.

When you use the Exchange Infrastructure (XI) message processing in Java, an error occurs. It is not possible to further analyze the cause of the error using the monitoring tools of the Runtime Workbench (component monitoring, message monitoring, and so on). It is necessary to create a "Trace File".


Procedure for Release XI 3.0, 7.0

Log on to the Visual Administrator. First navigate to "Global Configuration -> Server -> Kernel -> LogManager" and check whether the properties

- ConsoleLogs_UseSapAPI = YES
- ForceSingleTraceFile = YES
- SingleTraceFile_UnrestrictedLocations = [empty]

have their default values. You can use these properties to remove trace entries from the shared trace file so that they are not included in this shared trace file (./log/defaultTrace.trc), but are included in other files in the file system. You should do this only for development purposes and never in live systems. Therefore, use only the default values for these three properties on all server nodes.

Caution: If these parameters are set directly on a server node N under "Cluster > Server [N] -> Kernel -> LogManager", the global settings are overridden. Therefore, ensure that the properties also have the values described above on the affected server nodes.

In the next step, navigate to the "Log Configurator" service -> "Locations". Then open the branch "com.sap.aii" and change the trace level in the "Severity" field to DEBUG. Select "Copy Severity to Subtree" and save your entry. You have now set all the Java components of the Exchange Infrastructure (XI), including the Adapter Framework, to the DEBUG level.

If you can narrow down the cause of the error to particular parts of the XI Adapter Framework, set the trace level for the required subcomponents only. This way, you avoid unnecessary tracing. Then make sure that you reset the trace level of the XI basis location "com.sap.aii" to ERROR, propagate this to the subtree, and then save the changes.

For each server node N, the trace file is available in the file system under

/usr/sap/[SID]/[instance]/j2ee/cluster/server[N]/log/defaultTrace.[n].trc

The n trace files are written cyclically. You can change their size, number, and location in the file system using the kernel properties of the Log Manager (see above). Once a cycle is written, the files are zipped and then saved for each server node in the directory

/usr/sap/[SID]/[instance]/j2ee/cluster/server[N]/log/archive

  Provide us with these Java trace files as described in Note 40024, or attach the zipped trace files to the customer message.

Procedure for Releases XI 7.1 and 7.3

As of Release 7.1, the "Visual Administrator" was replaced by the "SAP NetWeaver Administrator". As a result, the procedure has changed as follows:

First start the Config Tool under /usr/sap/[SID]/[instance]/j2ee/configtool/configtool.[ext]. Under the affected instance, navigate to "Managers --> LogManager" and check whether the properties

- ConsoleLogs_UseSapAPI = YES
- ForceSingleTraceFile = YES
- SingleTraceFile_UnrestrictedLocations = [default]

have their default values. You can use these properties to remove trace entries from the shared trace file. Check this for all the nodes or instances.

In the next step, start the "SAP NetWeaver Administrator" with http://[server]:[port]/nwa and log on using an administrator user. Note that the following menu entries are displayed in the language set in your browser.

Navigate to "Problem Management -> Logs and Traces -> Log Configuration" (7.1) or "Troubleshooting/Fehlermanagement -> Logs and Traces/Protokole und Traces -> Log Configuration/Protokollkonfiguration" (7.3). Under 'Show/Anzeigen', select "Trace Locations/Trace Orte" and under 'Location/Standort', select "com.sap.aii" or/and "com.sap.engine.messaging". Set the required trace level in the 'Severity/Gewichtung' column and propagate it using "Copy to Sub-Tree/Zum Teilbaum kopieren". Then save your changes. Depending on the problem, you have to do this at the root "com.sap.aii" or "com.sap.engine.messaging" or for a specific package.

Important: You should never select the severity DEBUG or ALL for the entire "com.sap.aii" or "com.sap.engine.messaging" node because this affects system performance greatly. Consult SAP Support with regard to the required subtrees.

Reproduce the problem and then make sure that you reset the trace level of the XI basis location "com.sap.aii"/"com.sap.engine.messaging" to ERROR, propagate this to the subtree, and then save the changes. The system performance may be poor due to tracing.

The n trace files are written cyclically. You can configure their size, number, and location in the file system in the Config Tool (see above) under the instance -> log configuration -> destinations -> default_trace. Once a cycle is written, the files are zipped and then saved for each server node in the directory

/usr/sap/[SID]/[instance]/j2ee/cluster/server[N]/log/archive

  Provide us with these Java trace files as described in Note 40024, or attach the zipped trace files to the customer message.

You can view the trace files under "Problem Management -> Logs and Traces -> Log Viewer" (7.1) or "Troubleshooting/Fehlermanagement -> Logs and Traces/Protokole und Traces -> Log Viewer" (7.3). For this, select in the dropdown list 'selected view' "DefaultTrace (Java)" (7.1) or 'View --> OpenView --> Developer Traces' (7.3).

Tips and tricks for Release XI 3.0, 7.0

- If the problem is so severe that the Visual Administrator tool no longer starts or that its performance is poor, use the "Standalone Log Viewer" to display the log files and the trace files.
Start the Standalone Log Viewer under:

/usr/sap/[SID]/[instance]/j2ee/admin/logviewer-standalone/logviewer.[ext]

You can use the Standalone Log Viewer (a) to display trace files that are stored locally on the hard disk, (b) to access the traces of a remote J2EE instance using the p4 port (5[Inst.No]04, for example, 50004, if your J2EE instance number is 00), or (c) to connect to a Log Viewer server. Detailed information about this topic is available in the "Logviewer_Userguide.pdf" in the directory mentioned above.
You cannot use the Standalone Log Viewer to change the severity of a location. Otherwise, the Standalone Log Viewer has exactly the same functions as the "Integrated Log Viewer" of the Visual Administrator.

- The "Command Line Log Viewer" (lv.bat or lv.sh) is available in the same directory as the Standalone Log Viewer. You can use this tool to convert the default trace into a readable format. To do this, call the script, for example, using

lv.bat defaultTrace1.trc -o defaultTrace1.txt -format %d %t %l %s %m

   Use "lv -help" for additional information about this tool.

- IMPORTANT: In addition to the default trace files described above, the directory

/usr/sap/[SID]/[instance]/j2ee/cluster/server[N]/log/system

contains trace files that are specifically reserved for the J2EE Engine (server.[i].log, database.[i].log, security.[i].log, userinterface.[i].log). Especially "server.[i].log" often contains important information if errors occur.
In the Standalone Log Viewer or the Integrated Log Viewer, select both the default trace and the "server.[i].log". Right-click to open the context menu and choose "Merge Files and display". The trace that is then displayed contains the information for both trace files (sorted according to time).

- The "Location" column of the trace file is very important for the developer analysis. Use "drag and drop" to drag the "Location" column of the Log Viewer to the third position next to the "time" and "date" columns. You can right-click and use the context menu to select which columns are to be displayed (click the column names).

- For an initial analysis, it is often sufficient if you send us individual lines of the trace (for example, ERROR messages or stack traces). To do this, select the relevant line(s) in the trace file display of the Log Viewer, right-click the entry to open the context menu and then choose "Copy". Send us this information directly in a customer message.  You can use the indicator "Use OSS Copy" to directly convert the message of a trace line (by double-clicking the line) to a format that has 72 characters.

- If you experience problems with the Log Viewer tools, refer to Note
621466, or create a customer message under the relevant component.


Related Articles