Explaining Logging and Staging

Objectives

After completing this lesson, you will be able to:
  • Explain the difference between logging and staging
  • Configure the logging and staging behavior

Saving of Message Versions

In the SAP NetWeaver Administrator tool, you can specify the Logging and Tracing behavior as well as the Staging behavior.

There are two options to store messages at runtime:

Staging

You can store versions of asynchronous messages at runtime after specific steps of the message pipeline. An Administrator can then edit the message at each stage and then restart and process the message again.

This function is only available for messages processed by the AAE.

Message Logging

You can store versions of synchronous and asynchronous messages at runtime after specific steps of the message pipeline to make these messages available for logging purposes at a later point in time. Logged messages are only available in display mode and cannot be restarted anymore.

Global Configuration of Staging

This function is available for asynchronous messages processed by the Advanced Adapter Engine (AAE). You can save asynchronous messages that are processed in the AAE either before or after a processing step.

There are two possibilities to configure staging for your messages. The first option is to configure Staging globally, that means, for all scenarios running on the PI landscape.

Note

To keep the global logging and staging activities to a minimum to save memory or database resources, you should switch on logging and staging only for important pipeline steps.

You can enhance the global settings for logging and staging by specific scenarios settings that are covered by an integrated configuration.

The figure, Processing Steps Within the AAE, shows the sequence of processing steps for message processing in the Advanced Adapter Engine.

You can store message versions after the following processing steps within the pipeline:

Store Message Versions After Processing Steps Within the AAE

Processing StepDescription

Message preparation (parameter BI)

After sender adapter processing, the message is handed over to the messaging system and prepared for further processing.

Inbound XML validation (parameter VI)

The inbound message is validated against a schema.

Receiver and Interface determination (parameter MS)

The receivers of the message and the inbound interfaces are evaluated based on the configuration settings in the corresponding Integrated Configuration in the Integration Directory

Mapping (parameter AM)

The mapping is performed based on the configuration settings in the corresponding Integrated Configuration in the Integration Directory

Outbound XML validation (parameter VO)

The outbound message is validated against a schema.

You can use parameters BI, VI, MS, AM, and VO to define whether a message version is to be saved. You have the following options to define the mode of further processing for each step:

  • 0 (MODE_NO_STORE)

    The processor does not save message versions; it continues with the next processing step.

  • 1 (MODE_STORE_ON_ERROR)

    The processor only saves a message version if an error occurs in the next processing step.

  • 3 (MODE_STORE_AND_RETURN)

    The processor saves the message and continues with the next processing step.

Note

At least one of the processing steps must be configured with value 3.

To Configure Storing of Message Versions

To configure storing of message versions, use parameter xiadapter.stage.conf, which belongs to the service XPI adapter: XI.

Perform the following steps:

Steps

  1. Call SAP NetWeaver Administator.

  2. Choose ConfigurationInfrastructureJava System Properties.

  3. On the Services tab, select XPI Adapter: XI.

  4. Enter values for the xiadapter.stage.conf property. Enter the values using format: <processing step> = <condition> For example, BI=1, MS=3.

    Hint

    If you do not make any entries, the message is saved in the Advanced Adapter Engine after the receiver determination, which corresponds to the entry MS=3.

How to Maintain Global Staging Settings

Steps

  1. Call SAP NetWeaver Administrator.

  2. Choose ConfigurationInfrastructureJava System Properties.

  3. On the Services tab, in the Filter area, enter XPI Adapter: XI.

  4. On the Properties tab, select xiadapter.stage.conf.

  5. Choose the Modify button.

  6. In the Modify Property Value window, in the Enter Custom Value field, enter, for example, AM=3.

  7. Choose the Set button.

  8. Save your settings.

Global Configuration of Logging

There are two possibilities to configure message logging. The first option is to configure Message Logging globally, that means, for all scenarios running on the PI landscape.

You can log messages either in the pipeline of the Advanced Adapter Engine or within the processing of a chain of modules of an adapter.

To configure Message Logging in SAP NetWeaver Administrator, follow the high-level description:

  1. Call SAP NetWeaver Administrator.

  2. Choose ConfigurationInfrastructureJava System Properties.

  3. On the Services tab, select XPI Adapter: XI.

  4. Enter values for the xiadapter.logger.conf property. Enter values according to the following syntax:<processing step> = <condition>. You can separate multiple expressions like that by commas.

As Processing step, you can specify one of the following steps within the pipeline processing for asynchronous and synchronous request messages:

Specifications of the Processing Step

Processing Step

Description

Message Preparation (parameter BI)

After sender adapter processing, the message is handed over to the messaging system and prepared for further processing.

Receiver determination (parameter MS)

The receivers of the message are evaluated based on the configuration settings in the corresponding Integrated Configuration in the Integration Directory

Mapping (parameter AM)

The mapping is performed based on the configuration settings in the corresponding Integrated Configuration in the Integration Directory

The message will be logged after the specified step.

For synchronous response messages, the mapping is executed before the message is handed over to the messaging system and Receiver determination is skipped because the receiver is already known. To be able to store the message before and after the mapping step, in case the logging is configured for the AM step, the response message will be logged just before the mapping (because it comes from the synchronous receiver).

Specifications of the Synchronous Processing Step

Processing Step

Description

Mapping (parameter AM)

The mapping is performed based on the configuration settings in the corresponding Integrated Configuration in the Integration Directory. (message is logged before this step)

Message Preparation (parameter BI)

The message is prepared and handed over to the messaging system for further processing.

The figure above shows the processing steps for synchronous messages.

The figure above shows the processing steps for asynchronous messages.

Use the values from the table to specify the logging conditions:

Specify the Logging Conditions

Digit

Condition

1

Asynchronous messages are logged.

2

Synchronous messages are logged.

3

Synchronous and asynchronous messages are logged.

5

Only asynchronous error messages are logged.

6

Only synchronous error messages are logged.

7

Synchronous and asynchronous error messages are logged.

9

As setting 1, with the business content (payload) hidden.

10

As setting 2, with the business content (payload) hidden.

11

As setting 3, with the business content (payload) hidden.

13

As setting 5, with the business content (payload) hidden.

14

As setting 6, with the business content (payload) hidden.

15

As setting 7, with the business content (payload) hidden.

As default, no value is assigned, which means that messages will not be logged.

Example:

AM=14 means: synchronous error messages are logged between mapping and schema validation and the payload is hidden.

Configuring Message Logging in Case of Errors

To activate logging in case of errors in any case, follow the high-level description:

  1. Start SAP NetWeaver Administrator from the following page: http://<host>:<port>.

  2. Choose SAP NetWeaver Administrator.

  3. Choose ConfigurationInfrastructureJava System Properties.

  4. In the Services tab, search for XPI Service: Messaging System.

  5. On the Properties tab (under Extended Details), search for messaging.system.statusLoggerConf.

  6. To specify message logging behavior, choose Modify. In the field Enter Custom Values, enter the corresponding values according to the following syntax:

<log state>, <content handling>

As log state, you can specify one of the following values:

Log State

Value

Description

Error

Log messages in case of errors.

None

No logging of messages.

To specify the handling of business content, you use one of the following values:

Handling of Business Content

Value

Description

Full

If logging is enabled, log messages with business content (payload).

Headers

If logging is enabled, log messages without business content (payload).

As default, the value Error, Full is assigned, which means that messages are logged including business content in case of errors.

The location SC is used for the logged message version. This log message is also visible in PI overview monitoring.

Configure Message Logging Within Adapter Module Chain

You can log messages at arbitrary stations within the processing of a module chain of an adapter. That means, you can define your own processing steps at which logging is to take place.

Note

This kind of message logging is only feasible in scenarios where adapter modules are involved in message processing.

You configure this kind of message logging in Integration Directory at the communication channel that is defined for the corresponding adapter.

To configure this kind of Message Logging, open the Integration Directory and select the communication channel that is defined for the corresponding adapter. Follow the high-level description:

  1. Open the Integration Directory.

  2. Open the communication channel.

  3. Open the Module tab.

  4. Under Processing Sequence, the modules are listed which are processed by the adapter.

  5. Enter a new row between the modules where the message should be logged.

  6. In column Module Name, enter the string MessageLoggerModule.

  7. To specify the logging details, select module MessageLoggerModule and enter the corresponding parameters and parameter values. (see table below).

  8. Save and activate the communication channel.

Log Parameters

Parameter Name

Description

Parameter Values

log.condition

Specifies logging condition

You can assign an integer derived out of the following digits:

  • 2 (synchronous messages are logged)

  • 4 (only error messages are logged)

  • 8 (business content is hidden)

log.location

Name of logging steps

You can enter a name for the station or processing step within the module chain where the message should be logged.

When you display logged messages in monitoring, the processing step is displayed under Message Versions. Note that the module name must be prefixed with AF_Modules.

Local Configuration for Logging and Staging

As an alternative to Global Logging and Staging and to reduce the consumption of memory and database resources, you can use "local" Logging and Staging. In this case, "local" means, you can configure it for each iFlow or Integrated Configuration separately.

Follow the high level procedure to enhance Logging or Staging for your iFlow or Integrated Configuration:

  1. Open NWDS and open your iFlow.

  2. On the Properties tab, select Runtime Configuration.

  3. Specify if you want to save message versions for staging or logging.

    • For asynchronous message processing, you make the settings for staging or logging.

    • For synchronous message processing, you make the settings for logging.

  4. Specify if you want to configure staging or logging globally or scenario-specific (local).

    • Use Global Configuration.

      If you choose this option, those settings are effective which were configured in NetWeaver Administrator using Java System Properties.

    • Using Scenario-Specific Configuration

      If you choose this option, you can enhance the global setting for logging and staging for this Integration Flow.

  5. If you have selected the scenario-specific configuration, you must enter for staging or logging the steps after which the message versions are to be saved.

For each staging step, you have the following options to specify when you want to save a message:

None
Message version not saved.
Store on error
Message version saved, when the following step has errors.
Store
Message version saved and the processing will continue with the next step.

For each logging step, you have the following options to specify when you want to save a message:

None
Message version not saved.
Log

Message version saved for logging.

Log on error

Message version saved for logging in case of errors.

Log without payload

Message version saved for logging. Payload cannot be displayed.

Log without payload on error

Message version saved for logging in case of errors. Payload cannot be displayed.

Enhance Global Staging Settings

Task 1: Check the Global Staging and Logging Settings in the SAP NetWeaver Administrator Tool

Steps

  1. Start the SAP NetWeaver Administrator tool.

    1. In the browser, navigate to http://nwktdc00.wdf.sap.corp:50000/dir.

    2. On the SAP NetWeaver Process Integration screen, choose SAP NetWeaver Administrator.

  2. Open Java System Properties and select XPI Adapter: XI.

    1. Navigate to ConfigurationInfrastructureJava System Properties.

    2. On the Java System Properties: Overview screen, select the Services tab.

    3. Activate the Filter function.

    4. As filter in the Name column, enter XPI Adapter: XI.

  3. Check the logging and staging settings.

    1. On the Properties tab, under Extended Details, in the Filter field for the Name column, enter logger.

    2. As result, you will see the line xiadapter.logger.conf.

    3. Check the settings.

    4. To check the staging settings, in the Filter field for the Name column, enter stage.

    5. Check the settings for result xiadapter.stage.conf.

Task 2: Adapt the Staging Setting AM=3 in Your Integrated Configuration

Steps

  1. Adapt the staging setting in your Integration Flow.

    1. Go to the SAP NetWeaver Developer Studio.

    2. Navigate to your iFlow iFlow_MaterialA_MaterialB_##.

    3. On the Properties tab, select Runtime Configuration.

    4. Choose the staging: Use scenario-specific configurations.

    5. For Mapping (AM Step), choose Store.

    6. Save, activate, and deploy your scenario.

  2. Test your scenario and check the Monitoring.

    1. Open HTTP Client – Material (which was already described in a former exercise).

    2. Replace ## with your group number.

    3. Choose Send.

    4. Open Configuration and Monitoring Home (PIMon).

    5. Choose MonitoringAdapter EngineMessage Monitor.

    6. Search for you send message.

    7. Check the Message Content of your message. You will now see the payload after the Mapping step.