This topic describes how to view Message Service (MNS) operations logs in the Object Storage Service (OSS) console.
Usage notes
- MNS operations logs are generated at an interval of one minute and stored as OSS objects that comply with specific naming conventions in a specified OSS bucket.
- Operation logs of queues and topics have different paths. For more information about specific paths, see the following sections: Operation logs of queues and Operation logs of topics.
- The log files are stored in the JSON format. You can download and process log files.
- Each log file is a map. The key is the message ID and the value is multiple logs that record operations on the message. Each operations log contains multiple fields, such as Action and Time.
- Logs can be pushed from MNS to Log Service about 15 minutes after the logs are generated.
Prerequisites
- Log Service is activated.
You can activate Log Service on the Log Service product page.
- Log Service is authorized to access OSS.
You can go to the Cloud Resource Access Authorization page to authorize Log Service to access OSS.
Background information
- Real-time log query allows you to query logs from the past seven days free of charge. If the log retention time that you set is longer than seven days, Log Service charges the fees for the excess days. Extra fees are charged when you read data from or write data to Log Service over the Internet.
- Log Service allows you to store 900 GB of logs (equivalent to 900 million 1-KB log entries) per day free of charge, and charges fees for excess logs.
Enable real-time log query
You can use one of the following methods to enable real-time log query:
Method 1: Enable real-time log query when you create a bucket
Method 2: Enable real-time log query on the overview page of a bucket
- Log on to the OSS console.
- Click Buckets, and then click the name of the target bucket.
- Choose .
- Click Activate Now.
Real-time log query allows you to query logs from the past seven days free of charge. You can click Config Log Retention Time in the upper-right corner to modify the retention time of logs.
Query real-time logs
You can use one of the following methods to query real-time logs:
Method 1: Query real-time logs on the Original Log page
Method 2: Query real-time logs on the Dashboard page
Method 3: Query real-time logs in the Log Service console
You can view OSS access logs in the Log Service console. For more information, see OSS access logs.
Use the command-line tool to query logs
The command-line tool provides the queryqueuelog and querytopiclog commands. These commands allow you to specify a queue name, topic name, message ID, and time range to query operations logs. For more information, see Log query tool.