Contact Us 1-800-596-4880

Configuring Message Logging for Flex Gateway in Connected Mode

Applying a Message Logging policy to your API instance in API Manager allows you to view basic logs for APIs managed by Flex Gateway within API Manager. Logging for an API instance only happens if you configure and apply a Message Logging policy.

Message Logging Limits and Features

API Manager stores up to 100 MB of logs per API instance for 30 days. Runtime Manager automatically purges logs that go beyond 100 MB per API instance. If you need more storage, you can either use a third-party service (configured through a policy) or sign up for a Titanium subscription.

For each API instance configured through a policy, basic logs report the following:

  • Inbound and outbound API calls, as well as the packet contents

  • Headers and any other information in the request

To view message logs in API Manager, you need one of the following permissions:

  • API Manager Environment Administrator

  • API Manager Deploy API Proxies

  • General Organization Administration

Before You Begin

Before configuring message logging for a Flex Gateway, complete the following tasks:

Configure Message Logging in Connected Mode

  1. From API Administration in API Manager, select the name of the API Instance.

  2. Click Policies.

  3. Click + Add policy.

  4. Under the Troubleshooting category, click Message Logging.

  5. Click Next.

  6. Click + Add.

  7. Enter a Configuration Name, for example, Info messages before calling API.

  8. Enter a DataWeave expression that selects what information you want to see.

    For example, #[attributes.header['id']] extracts the ids from the headers of the messages. See Predefined Variables in the DataWeave documentation for more information.

  9. If you want to filter log messages, enter a DataWeave expression.

    For example, #[attributes.headers['id']==1] displays log messages that have an id of 1 in the header.

  10. If you want to affix a prefix to your logs, enter a Category.

  11. Enter the severity level.

    You can only enter one level. See Message Logging Severity Levels for a description of each severity level and the hierarchy for the levels.

  12. If you want messages after the API is called, select After Calling API.

  13. If you want to add additional configurations, click + Add.

  14. Click Save.

    Afterward, you should see a Message Log option for the API instance.

    Use the search field to search for specific logs based on the time and log severity (INFO, ERROR, WARN, DEBUG). You can download these logs for further analysis.

Message Logging Severity Levels

When you configure a Message Logging policy for your API instance you can assign a severity level.

Severity Levels Description

Each severity level includes a specific set of information in the log report. The following table describes the type of information that will be included in the logs for each severity level.

Log Severity Level Description

ERROR

Error events that prevent normal program execution but might allow the application to continue running.

WARN

Potentially harmful situations that indicate potential problems.

INFO

Informational messages that highlight the progress of the application.

DEBUG

Tracing information used by application developers.

Severity Levels Hierarchy

Log reports include only the severity level you select and the subsequent levels on the hierarchy . For example, if you select INFO, the log reports include the WARN and ERROR severity levels. However, if you select ERROR, the log reports include only error messages. The following table describes the hierarchy of the different severity levels:

ERROR WARN INFO DEBUG

ERROR

WARN

INFO

DEBUG