Using the Logging Facility

Introduction

Ariba Supplier OnRamp Adapter logging facility logs messages about the punchout process, regardless of whether you use Trading Networks.The log entries can also be configured to log messages related to MasterAgreementRequest and InvoiceDetailRequest processes.

Message Categories and Log Entry Types

Ariba Supplier OnRamp Adapter provides the following categories of log messages that you can enable or disable:

  • PunchOutSetupRequest. Messages related to the PunchOutSetupRequest/PunchOutSetupResponse transaction.
  • OrderRequest.Messages related to the OrderRequest/OrderResponse transaction.
  • MasterAgreementRequests. Messages related to the MasterAgreementRequest/Response transaction.
  • InvoiceDetailRequest. Messages related to the InvoiceDetailRequest/Response transaction.
  • General Messages.Messages about other transactions apart from the transactions handled by the four messages specified above.

The types of log entries are informational (messages indicating status) and error (messages indicating processing errors).

For more information, see Enabling Logging.

Log Messages Created by Ariba Supplier OnRamp Adapter

In addition, Ariba Supplier OnRamp Adapter automatically creates log messages when it:

  • Receives a valid cXML request (an informational message).
  • Receives an invalid cXML message or MIME message (an error message).
  • Encounters an error returned by your handler.
  • Sends a cXML response (an informational or error message).

Additional Log Entries

If you want to log additional entries, use the public APIs of Ariba Supplier OnRamp Adapter as described in Using the Logging APIs.

Log Message Storage

When you use Ariba Supplier OnRamp Adapter without Trading Networks, its logging facility stores log messages in an XML file on Integration Server, in the logs/ariba/supplier directory in the Integration Server_directory.

The most current log file is named cxmlmessages.log. The current log file is automatically rolled over" around midnight, and is renamed cxmlmessages.yyyymmddhh.log (where yyyymmddhh is year, month, day, hour).

When you use Ariba Supplier OnRamp Adapter with Trading Networks, messages are logged using the Activity Log feature of Trading Networks.

Enabling Logging

About this task

You use the Config menu to enable logging.

To enable logging

Procedure

  1. Start Integration Server Administrator.
  2. In the IBM webMethods Adapter for Ariba Supplier OnRamp menu, select Config. The Ariba Supplier OnRamp Adapter Configuration screen appears.
  3. In the Logging Configuration section of the page, select the kinds of messages that you want to log, as described in the following steps.
    1. Click the PunchOutSetupRequests check box if you want to log all PunchOutSetupRequest messages that you receive.
    2. Click the OrderRequests check box if you want to log all OrderRequest messages that you receive.
    3. Click the MasterAgreementRequests check box if you want to log all MasterAgreementRequests messages that you receive.
    4. Click the InvoiceDetailRequests check box if you want to log all InvoiceDetailRequests messages that you receive.
    5. Click the General Messages check box if you want to log all other messages that you receive.
  4. Click the Update button in the Logging Configuration section of the page.
  5. Verify that the logging services are set up correctly as follows by clicking the Advanced configuration …link.

    A screen appears, showing the following services:

    Service Type Service Name if Trading Networks is Not Used Service Name if Trading Networks is Used
    SetupRequestEventLogging wm.ariba.supplier.logImpl.Files: logPunchOutSetupEvent wm.ariba.supplier.tn.logImpl: logPunchOutSetupEvent
    OrderRequestEventLogging wm.ariba.supplier.logImpl.Files: logOrderEvent wm.ariba.supplier.tn.logImpl: logOrderEvent
    MasterAgreementRequest Event Logging wm.ariba.supplier.logImpl.file: logMasterAgreementEvent wm.ariba.supplier.tn.logImpl: logMasterAgreementEvent
    InvoiceDetailRequest Event Logging wm.ariba.supplier.logImpl.file: logInvoiceDetailEvent wm.ariba.supplier.tn.logImpl: logInvoiceDetailEvent
    GeneralEventLogging wm.ariba.supplier.logImpl.Files: logEvent wm.ariba.supplier.tn.logImpl: logEvent
    GetLogService wm.ariba.supplier.logImpl.Files: getLog wm.ariba.supplier.tn.logImpl: getLog
    Get Log Names wm.ariba.supplier.logImpl.Files: getLogFiles wm.ariba.supplier.tn.logImpl: getLogFiles

Results

If these service names are not shown, click the Set to Default File Logging button (or the Set to Default Trading Networks Logging button) to reset the logging services to the default logging services listed above.

Note: For advanced applications, you can implement customized logging services and register your custom services with the Logs Module. If you follow the default implementations above, you will be able to use your custom services with the Ariba Supplier OnRamp Adapter package.

This should only be done if you want to support your own logging implementation, such as writing log entries to a database.

Using the Logging APIs

Ariba Supplier OnRamp Adapter performs logging when it receives requests, when it returns cXML responses, and when it encounters errors in your handler implementation, as described in Log Messages Created by Ariba Supplier OnRamp Adapter. If you want to log additional entries, use the public APIs of Ariba Supplier OnRamp Adapter.

The following table describes the logging services you can use to log messages. You use the same services regardless of whether you use Trading Networks.

Use this logging service … To …
pub.ariba.supplier.log:logPunchOutSetupEvent Log informational or error messages about PunchOutSetupRequest/SetupResponse messages.

You specify a log message string to write to the log entry. This service writes this message to the log entry, extracts the following fields from the PunchOutSetupRequest, and writes these fields to the log entry:

  • payload ID
  • buyer credential
  • supplier credential
  • sender credential
  • Buyer Cookie
  • BrowserFormPost URL

You can also log additional data fields if needed. This service also extracts the catalog start page URL from the PunchOutSetupResponse and writes it to the log entry.

pub.ariba.supplier.log:logOrderEvent Logs informational or error messages about OrderRequest/OrderResponse messages.

You specify a log message string to write to the log entry. This service writes this message to the log entry, extracts the following fields from the OrderRequest, and writes these fields to the log entry:

  • payload ID
  • buyer credential
  • supplier credential
  • sender credential
  • Order ID

You can also log additional data fields if needed.

pub.ariba.supplier.log:logEvent Log informational or error messages.

This service is a general logging service you can use to log any message. This service has many fields you must manually set if you want them to appear in the log entry.

logMasterAgreementEvent Log informational or error messages about MasterAgreementRequest/MasterAgreementResponse messages.

You specify a log message string to write to the log entry. This service writes this message to the log entry, extracts the following fields from the MasterAgreementRequest, and writes these fields to the log entry:

  • payload ID
  • buyer credential
  • supplier credential
  • sender credential
  • AgreementID

You can also log additional data fields if needed.

logInvoiceDetailEvent Log informational or error messages about InvoiceDetailRequest/InvoiceDetailResponse messages.

You specify a log message string to write to the log entry. This service writes this message to the log entry, extracts the following fields from the InvoiceDetailRequest, and writes these fields to the log entry:

  • payload ID
  • buyer credential
  • supplier credential
  • sender credential
  • InvoiceID

You can also log additional data fields if needed.

For complete information about how to use these logging services, see pub.ariba.supplier.log.spec.

Viewing Log Entries

About this task

You use Logs to view log entries of cXML messages sent and received.

To view logs

Procedure

  1. Start Integration Server Administrator.
  2. In the IBM webMethods Adapter for Ariba Supplier OnRamp menu, select Logs. The Log page appears.
  3. Select one of the following values from the Log Name drop-down list:
    • If not using Trading Networks:

      • Most recent-The most recent log file.
      • Specific log file-A log file has the following format:

        cxmlmessages.yyyymmddhhmm.log

        where yyyymmddhhmm is year, month, day, hour, minute.

    • If using Trading Networks:
    • Select one of the following time frames allowed in Trading Networks:

      • Most recent-The most recent log entries.
      • Yesterday-Log entries from yesterday.
      • This Week-Log entries from this week.
      • Last Week-Log entries from last week.
  4. Type a number in the Number of entries to show field to specify how many entries to display on a page, or accept the default (20).
  5. Click the Refresh button to display the entries of the selected log file.

Storing OrderRequest Messages

Ariba Supplier OnRamp Adapter is capable of storing OrderRequest messages.

When you use Ariba Supplier OnRamp Adapter Ariba Supplier OnRamp Adapter without Trading Networks, the built-in document store facility of Ariba Supplier OnRamp Adapter stores the messages. To configure the document store facility, you simply enable the default services of Ariba Supplier OnRamp Adapter. Alternatively, you can create your own document store facility.

When you use Ariba Supplier OnRamp Adapter with Trading Networks, the document store facility of Trading Networks stores messages by default. To enable Ariba Supplier OnRamp Adapter to access this document store facility, you simply ensure that its default service retrieving orders from Trading Networks is set.

Configuring the Document Store for NonTrading Networks-Enabled Systems

About this task

To configure the document store facility

Procedure

  1. Start Integration Server Administrator.
  2. In the IBM webMethods Adapter for Ariba Supplier OnRamp menu, select Config. The Ariba Supplier OnRamp Adapter Configuration screen appears.
  3. Click the OrderRequests check box in the Logging Configuration section of the page if you want to store all OrderRequest messages that you receive.
  4. Click the Update button in the Store Documentssection of the page.
  5. Click the Advanced Configuration… link and verify that the following default store services are set:
    Service Type ServiceName
    Store Order wm.ariba.supplier.docstoreImpl.file:storeOrder
    Retrieve Order wm.ariba.supplier.docstoreImpl.file:retrieveOrder
    Remove Order wm.ariba.supplier.docstoreImpl.file:removeOrder
    Retrieve Attachment wm.ariba.supplier.docstoreImpl.file:retrieveAttachment
    Retrieve All Attachments wm.ariba.supplier.docstoreImpl.file:retrieveAllAttachments
  6. If the service names are not correct, click the Set to Default File Store button to reset the services to the default services above.
    Note: You can create your own document store facility to store the OrderRequests and attachments. To do this, you create services using the specifications of the pub.ariba.supplier.docstore.spec folder. This folder contains all the service specifications you will need to implement services to save, retrieve, and remove OrderRequest messages to a custom persistent store. You then register your services here.

Configuring the Document Store for Trading Networks-Enabled Systems

About this task

The Trading Networks document store facility stores messages by default. To configure Ariba Supplier OnRamp Adapter to use the Trading Networks document store facility, you simply ensure that the default service to retrieve orders from Trading Networks of Ariba Supplier OnRamp Adapter is set.

Note: To disable the Trading Networks document store, you must use Trading Networks and change the document definition so that it does not persist the document. You cannot do this from Ariba Supplier OnRamp Adapter.
Note: Attachment documents cannot be stored in Trading Networks currently. To store attachments, you must implement a custom store facility.

To configure the service to retrieve orders stored in Trading Networks

Procedure

  1. Start Integration Server Administrator.
  2. In the IBM webMethods Adapter for Ariba Supplier OnRamp menu, select Config. The IBM webMethods Adapter for Ariba Supplier OnRamp Configuration screen appears.
  3. In the Store Documents section, click the Advanced Configuration…link and verify that the following default store service is set:
    Service Type ServiceName
    Retrieve Order wm.ariba.supplier.tn.docstoreImpl.file:retrieveOrder
  4. If the service name is not correct, click the Set to Default Trading Networks Store button to reset the service to the default service above.