You can push Message Service (MNS) logs to Log Service and view operations logs in the Log Service console. You can query the message trace based on the message ID to diagnose exceptions. This topic describes how to configure MNS and Log Service to push logs.

Prerequisites

  • A project and a Logstore are created. For more information, see Step 1: Create a project and a Logstore.

    You can push operations logs of queue messages and topic messages to a project that resides in the same region as the queues and topics.

  • MNS is authorized to use the AliyunMNSLoggingRole role to push logs to Log Service.
    You can go to the Cloud Resource Access Authorization page to complete the authorization.
    Notice
    • This operation is required only when you enable the log management feature for the first time. You must complete the authorization by using your Alibaba Cloud account.
    • If you use a RAM user to log on to MNS, you must grant required permissions to the RAM user. For more information, see RAM user authorization.
    • To ensure that MNS operations logs can be pushed to Log Service, do not revoke permissions from the RAM role or delete the RAM role.

Procedure

  1. Log on to the MNS console.
  2. Select a region in the top navigation bar.
  3. In the left-side navigation pane, click Logging Management.
  4. On the Logging Management page, find the region and click Action in the Action column.
  5. In the Configurations dialog box, click the Push Logs to LogService tab. Select the project that you created from the Project drop-down list and select the Logstore that you created from the LogStore drop-down list. Click OK.

Result

The bucket is displayed in the Log/OSS column on the Logging Management page.

What to do next