Logs

gateway83
View Logs
The Policy Manager has a built-in log viewer that you can use to view
API Gateway
 node logs from any cluster node, provided that the log files are associated with an existing log sink. Use the logs to help you diagnose and resolve problems for a node.
Logs may also be viewed on the
API Gateway
appliance, from the
API Gateway
main menu.
 
To view logs
:
  1. In the Policy Manager, select [
    View
    ] >
    View Logs
    from the Main Menu (on the browser client, from the Monitor menu). The available logs to view are listed. If the list of logs is long, you can filter the display by entering some text into the Filter box. The filter string is matched against all columns, except for "Last Modified".
    When a filter is in place, the following message is displayed to remind you that the list is filtered: "Caution! Filter may exclude some logs." 
    Only local logs are listed in the Select Log dialog. Local logs are those of type "File" in the Log Sink Properties.
  2. Select one or more log file(s) to view, then click [
    View
    ]. Tip: Hold down the [
    Ctrl
    ] key to select multiple files.The log details are displayed in the Log Viewer dialog.  The following table describes each part of the Log Viewer dialog:
    Setting
    Description
    <log entries>
    The box at the top of the dialog displays all the entries in the selected log. You can click on any line to view it in the log entry details box below.
    If the Tail option is selected, the list of log entries is updated dynamically, displaying the X most recent log entries.
    If a Filter is in place, this box displays only those log entries with text matching the filter string.
    <log entry details>
    When you select a log entry to view, the details are displayed in a more readable line-wrapped format in this details box.
    You can copy any part of the log entry detail by selecting the desired text and then pressing [Ctrl]-C.
    Filter
    To filter the list of log entries, type a filter string. The display is automatically updated to show only those lines containing the string. For example, to see only log entries with the severity WARNING, type 'warning' in the box.
    A message is displayed when a filter is in effect, to remind you that not all entries are visible.
    To clear the filter, delete the string.
    The filter string is matched anywhere within the log entry, with no case sensitivity.
    View last xxx line(s)
    Select this check box to display only the most xxx recent log entries . New lines are displayed as they become available (if not filtered). Enter how many recent entries to show, maximum 100.
    Clear this check box to display the entire contents of the log.
    You will need to click [
    Refresh
    ] to update the display after clearing this check box.
    Auto-Refresh
    Select this check box to have new log data retrieved from the
    API Gateway
    every few seconds. The log display will scroll automatically to display the latest lines in the log.
    Clear this check box to update the log only when the [
    Refresh
    ] button is clicked.
    Showing xx/xx line(s)
    Displays the total number of events currently displayed in the log window, out of the total number of viewable entries. This is useful to see how many lines are displayed when a filter is used.
    Refresh
    Click this button to update the log data displayed.
    The [
    Refresh
    ] button is not necessary when Auto-Refresh is enabled, but you can still use it to update the display in between auto refreshes.
    Cancel
    Click this button to cancel a manual refresh. For example, you may wish to cancel if a refresh is taking too long to complete.
    Last Updated
    Displays the date and time of the most recent update, whether auto or manual refresh.
     
  3. Click [
    Close
    ] to close the Log Viewer and the Select Log dialogs when done.
Save Logs
Before saving the log, be sure the entries you want to save are currently displayed. Data that is filtered out will not be saved. For example, if you were viewing 'Severe' events, only 'Severe' events will be saved. If you wish to save the entire log, be sure to clear the filter first.
To save the log
:
  1. In the Log Viewer dialog, select [
    File
    ] > Save as.
  2. Specify a file name and location or use the defaults presented.
    Accepting the suggested file name makes it easier to sort and organize your saved logs. Be sure to preserve the ".txt" file extension.
  3. Click [
    Save
    ].
 
To view the saved log
:
  • Open the saved log file using any text editor.
Customize the Audit Format for Logging
You can customize the format of audit messages that are recorded to a file or Syslog. There are three types of audit messages generated by the 
API Gateway
  • Administrative actions
  • System events
  • Message processing events
These message types are described in greater detail in Message Auditing.
For the purposes of customizing the audit format, the three message types are grouped into the following two categories:
  • Service-related
    : These are the message processing events
  • Other
    : These are the administrative actions and system events
The following terms are used to describe the parts of the audit information that can be customized:
  • header
    : This is the first log message related to processing of a message.
  • details
    : This is the detail log message for each audit detail.
  • footer
    : This is the final log message and relates to the audit record.
For service-related events, you can customize the header, footer, and details using these cluster properties:
 
Cluster Property
Description
Default
1
audit.log.service.headerFormat
Format for the first log message of a service audit
Processing request for service: {3}
2
audit.log.service.footerFormat
Format for the final (summary) log message of a service audit
{1}
3
audit.log.service.detailFormat
Format for details related to a service audit
{0}: {1}
4
audit.log.other.format
Format used for other (non-service) audit logs
{1}
5
audit.log.other.detailFormat
Format used for other (non-service) audit details
{0}: {1}
The following table describes in greater detail the variables that can be used in each cluster property.
 
 
 
Available for
:
Variable
Description
Example
1
2
3
4
5
{0}
Audit message ID
1234
Yes
No
No
Yes
No
{1}
Audit message
Authentication required
Yes
No
Yes
Yes
Yes
{2}
Service entity ID
a1g38fj352da
Yes
Yes
Yes
No
No
{3}
Service description
Warehouse or
Warehouse [/warehouse]
Yes
Yes
Yes
No
No
For even greater flexibility, you can add a context variable before the {x} placeholder variables for service-related events. This will insert the contents of the specified context variable when the audit is logged. For example:
audit.log.service.headerFormat = ${requestId}: processing message.
audit.log.service.footerFormat = ${requestId}: {1}
audit.log.service.detailFormat = ${requestId}: {0}: {1}
 
When using context variables, the maximum length permitted per variable is 1000 characters. The overall message size is limited to 10000 characters, subject to any limitations of the sink (for example, syslog size limits).