You can associate trace IDs with the business logs of an application. This way, if an error occurs in the application, you can access the business logs associated with trace IDs to find out and troubleshoot the error.


Note Only the Application Monitoring Pro Edition supports this feature.

The Application Real-Time Monitoring Service (ARMS) agent is upgraded to V2.6.1.2 or later. For more information, see Update the ARMS agent for Java applications.

Background information

In ARMS, trace IDs can be associated with the business logs of an application based on the Mapped Diagnostic Context (MDC) mechanism. Mainstream log frameworks such as Log4j, Log4j 2, and Logback are supported.

Associate trace IDs with business logs

  1. Log on to the ARMS console .
  2. In the left-side navigation pane, choose Application Monitoring > Applications. In the top navigation bar, select a region. On the Applications page, click the name of the application that you want to manage.
  3. In the left-side navigation pane, click Application Settings. On the page that appears, click the Custom Configuration tab.
  4. On the Custom Configuration tab, turn on Link Business Logs with TraceId in the Business Log Linking Settings section.
    • If you enable Link Business Logs with TraceId, trace IDs are automatically generated in the business logs.
  5. Add %X{EagleEye-TraceID} to the pattern property of the business log layout. The following figure shows how to add this configuration for the Logback component.
    Note For information about how to obtain {EagleEye-TraceID} from the business code, see ARMS SDKs.
  6. Restart the application.
    If trace IDs are displayed in the business logs of the application, the business logs are associated with the trace IDs, as shown in the following figure. dg_am_log_traceid