This topic describes how to view MNS operations logs in the Object Storage Service (OSS) console.

  • MNS operations logs are generated on a minute-by-minute basis and stored as OSS objects that comply with specific naming conventions in a specified OSS bucket.
  • The paths of operations logs for queues and topics are different. For more information about specific paths, see the following sections: Operations logs of queues and Operation logs of topics.
  • The format of log files is JSON. You can download and process log files.
  • A log file is a map, in which the key is the message ID and the value is multiple log entries that record operations on the message. Each log entry contains multiple fields, such as Action and Time.
  • Pushing logs from MNS to OSS buckets takes about 15 minutes.

Operations logs of queues

<LoggingBucket>/TopicMessageLog/<QueueName>/YYYYmmdd/HHMMSS/log 
Example: mnslogging/QueueMessageLog/TestQueue/20160229/101000/log 
Description: This file stores operations logs of the TestQueue queue from 10:10:00 on February 29, 2016 to 10:11:00 on February 29, 2016.             
  • LoggingBucket: the name of the logging bucket that you have configured.
  • QueueName: the name of the queue whose operations logs are stored in the object.
  • YYYY, mm, dd, HH, MM, SS: the start time of the logs in the object. YYYY, mm, dd, HH, MM, SS indicates the year, month, day, hour, minute, and second, respectively.

Operations logs of topics

<LoggingBucket>/TopicMessageLog/<TopicName>/YYYYmmdd/HHMMSS/log
Example: mnslogging/TopicMessageLog/TestTopic/20160229/100000/log
Description: This file stores operations logs of the TestTopic topic from 10:00:00 on February 29, 2016 to 10:01:00 on February 29, 2016.            
  • LoggingBucket: the name of the logging bucket that you have configured.
  • TopicName: the name of the topic whose operations logs are stored in the object.
  • YYYY, mm, dd, HH, MM, SS: the start time of the logs in the object. YYYY, mm, dd, HH, MM, SS indicates the year, month, day, hour, minute, and second, respectively.

Use the OSS console to view log objects

  1. Log on to the OSS console and click the required logging bucket to go to the Overview page.
  2. Click Files and go to the required sub-directory to view log objects.

Use the command-line tool to query logs

The command-line tool provides the queryqueuelog and querytopiclog commands, which allow you to specify a queue or topic name, message ID, and time range to query operations logs.