This topic describes how to enable the log management feature in the Message Service (MNS) console. After you enable the log management feature, you can push MNS operations logs to Log Service.

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.

Step 1: Configure log pushing

  1. Log on to the MNS console.
  2. In the upper-left corner of the page, select a region.
  3. In the left-side navigation pane, click Logging Management.
  4. Click Configurations in the Actions column of the selected region.
  5. In the Configurations dialog box, click the Push Logs to LogService tab. On this tab, select a project and a Logstore, and then click OK.
    Note MNS operations logs are pushed to the specified Logstore about 3 minutes after they are generated.

Step 2: Enable the log management feature

To enable the log management feature for operations logs of queue messages, perform the following steps:

  1. Log on to the MNS console.
  2. In the left-side navigation pane, click Queues.
  3. In the upper-right corner of the Queues page, click Create Queue.
  4. In the Create Queue dialog box, turn on the Enable Logging switch. For information about other parameters, see Create a queue.
  5. Click OK.

To enable the log management feature for operations logs of topic messages, perform the following steps:

  1. Log on to the MNS console.
  2. In the left-side navigation pane, click Topics.
  3. In the upper-right corner of the Topics page, click Create Topic.
  4. In the Create Topic dialog box, turn on the Enable Logging switch. For information about other parameters, see Create a topic.
  5. Click OK.

What to do next

After MNS operations logs are pushed to Log Service, you can query, analyze, download, ship, and transform the logs. You can also configure alerts for the logs. For more information, see Common operations on logs of Alibaba Cloud services.