Viewing App Connect logs in the log viewer
IBM® App Connect provides a built-in log viewer that you can use to manage and monitor messages that are emitted when your event-driven and API flows are invoked.
The log viewer also displays messages that are issued by your IBM App Connect Enterprise integration servers that are running in the App Connect on IBM Cloud® instance. By default, error and information messages are logged:
- error: An error message is emitted when an event, action, or some flow logic has failed.
- info: An information message is emitted at key points, such as when a flow is triggered, or when it completes successfully.
You can add Log nodes to your flows to issue custom log messages and custom fields for specific content that you want to log. You can also configure flows to issue extra debug messages:
- For information about adding Log nodes to flows, see Enhancing logging with customized log messages.
- To view debugging information for a flow, open the menu on a flow tile in the App Connect
dashboard then click Enable debug logging. Then restart your flow to start
debug logging for that flow, and open the log viewer to view the log entries.
When debug logging is enabled, you'll see a debug log entry for each node in the flow that completes successfully. The log entry includes the output data from that node (in JSON format). Each node in the flow has access to the output from all previous nodes. If the flow is configured with a Log node that is used to emit a custom message with a log level of 'debug', you’ll also see a log entry for that custom message.
- Viewing log messages for all your running flows and integration servers
- Viewing log messages for a failed event-driven flow or API flow
- Viewing log messages for a batch process in an event-driven flow or API flow
- Viewing and managing log messages for a specific integration server
- Viewing log messages in IBM Log Analysis
Viewing log messages for all your running flows and integration servers
To display the log viewer with messages for all your running flows and integration servers, on the dashboard click the Logs icon . In the log viewer, entries for each event that was logged for your running flows are displayed in individual rows under the following columns:
- Event time (UTC)/Event time (local): A timestamp depicting when an event occurred in UTC (the default) or in your browser’s local time.
- Message: A message describing the log event.
- Transaction ID: An auto-generated ID that uniquely identifies the transaction (or HTTP call) associated with the event.
- Flow ID: An ID that uniquely identifies the flow for which the event was logged. This ID changes whenever the flow is restarted.
- Log level: The logging level of the message, with an assigned value of
debug. Information and error messages are displayed by default. To view debug messages, you’ll need to enable debugging.
By default, the page displays up to 500 of the most recent events that were logged in the previous 24 hours.
Working with the log viewer
- You can expand each log entry to see additional details about that event. The arrow to the left of the Event time column can be used to expand or collapse a log entry.
- To change the sort order of the log entries, click the Event time (UTC) column header. Entries are displayed in descending timestamp order by default, but you can switch from a descending to an ascending sort order.
- To change the default timestamp from UTC to local time, click the Change log settings icon . Then click Browser local time.
- To apply a predefined time filter to see only those events that were logged during the selected time period, expand the time picker drop-down list and select a time. The default is Last 24 hours, but you can specify periods that range from the last 15 minutes to the last 30 days.
- To search for a specific string within the log entries in the current view, click the Search logs on this page icon and then enter (or copy and paste) the text string that you want to search for. As you type, the view refreshes to show any rows with a matching (case insensitive) value in the Message, Transaction ID, Flow ID, or Log level column, and within the event metadata sections. You can delete the search query from the search bar to revert to your previous view.
- To apply a filter query to refine your view of the log entries:
- Click the Build a query to filter logs icon .
- Add a condition by selecting a log column header, an operator, and a term or timestamp to filter
by. Then use Add condition to define additional conditions. For example, if you want to view
all the log messages that were emitted before a specific time and for a specific flow, you can
specify conditions for the Event time and Flow ID values as shown in the following
Tip: If you’d like to view log entries that were generated before the 500 entries in your current view, you can set an Event time condition to get more specific results. For example, you can use the before operator to retrieve the previous set of 500 (or fewer) entries that are generated before the earliest timestamp in your current view. Or you can use both the before and after operators to retrieve the log entries for a specific day or within a particular time period. For example, to retrieve the log entries for 20 May 2020, you can build a query with the following conditions:
- Event time after 2020-05-19 23:59:00.000
- Event time before 2020-05-21 00:00:00.000
- Click Apply to view all matching log entries. Notice that the Build a query to filter logs icon is annotated to indicate that filters are applied to the current view, and depict the number of filter conditions. If you specified a condition for the event time, the time picker drop-down list is disabled and displays the text "Absolute time set" to indicate that a time filter has already been applied. (Notice also that your browser URL reflects the sort order as well as the query that applies to your filtered view.) The filter query is retained until you remove it from your current view. To remove the filter, click the annotation.
- To refresh your view to show the latest events, click the Refresh icon . If currently applied, your filter or search context is retained when you refresh in this way (but won’t be if you choose to reload the browser page).
- To export the data in the log entries to a file for reference or analysis, click the Export
displayed logs icon . The
data is saved in JSON format to a file named
logs.jsonin the default download location for your browser. This data relates only to what is currently displayed in your view.
- To close the log viewer, click the dashboard icon or any of the other icons for other features.
Viewing log messages for a failed flow
When you access the log viewer in this way, you’ll see a filtered view of log entries that pertain to the errors for that flow only, based on the transaction ID.
If you’d like to see log entries for all your running flows, you can remove the Transaction ID filter query; for example, by clicking the Build a query to filter logs icon and then clicking Delete all conditions.
Viewing log messages for a batch process in an event-driven flow or API flow
In a similar manner to flow errors, you can also open a filtered view of your batch processing logs within the log viewer. This filtered view shows log messages from one batch process, and can be accessed as follows:
- From the App Connect dashboard, locate the tile for your batch processing flow. Open the tile’s options menu [⋮], then click View batches to view a summary of completed and running batches.
- To view related logs in the log viewer, click options (…) in the Actions column and then click View logs.
For more information, see How to use batch processing in IBM App Connect.
Viewing and managing log messages for a specific integration server
To view and manage event messages for a specific integration server within the log viewer, click the integration server’s tile on the dashboard, and then click View logs.
When the log viewer opens, you'll see a filtered view of log entries that pertain to that integration server only, based on the "flow ID" that’s assigned to the integration server. For example:
If you’d like to see log entries for all your running integration servers (and flows), you can remove the Flow ID filter query; for example, by clicking the Build a query to filter logs icon and then clicking Delete all conditions.
Extending your logging capability with the IBM Log Analysis service
You can extend the logging capability of your App Connect instance by provisioning and configuring an IBM Log Analysis service instance to aggregate logs from your applications and services in IBM Cloud. IBM Log Analysis offers benefits such as centralized logging, advanced filtering and searching, alerting, graphing, and archiving. When configured, App Connect logs from the logging service will be forwarded to your IBM Log Analysis instance. For information about configuring IBM Log Analysis to receive logs from App Connect, see Monitoring and managing App Connect logs in IBM Log Analysis.