Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Logs

Updated on 2024-04-19 GMT+08:00

Scenarios

You can use logs when you want to know the statuses of messages published to a topic. Protocols including SMS, email, HTTP and HTTPS are supported. Before configuring logs, you need to interconnect SMN with Log Tank Service (LTS) and have created a log group and log stream to be associated.

Configuring Cloud Logs

  1. Create a log group.
    1. Log in to the management console.
    2. Click on the upper left to select the desired region and project.
    3. Select Log Tank Service under Management & Governance.

      The LTS console is displayed.

    4. In the navigation pane on the left, choose Log Management.

      The Log Management page is displayed.

    5. Click Create Log Group. In the displayed dialog box, enter a log group name.
    6. Click OK.
  2. Create a log stream.
    1. Locate the created log group and click its name.
    2. Click Create Log Stream. In the displayed dialog box, enter a name for the log stream.
    3. Click OK.

Configuring Message Transmission Logs

On the SMN console, configure logs.

  1. Set this parameter on the Create Topic page.
    1. Log in to the management console.
    2. In the upper left corner of the page, click and select the desired region and project.
    3. Select Simple Message Notification under Application.

      The SMN console is displayed.

    4. In the navigation pane on the left, choose Topic Management > Topics.

      The Topics page is displayed.

    5. On the Topics page, click the name of the topic to be configured.
    6. On the displayed page, click the Message Transfer Logs tab, and click Configure Access Logs.
    7. Click Start Logging and select the log group and log stream that you have created on the LTS console.
    8. Click OK.

Viewing Access Logs

You can view details about logs you configured.

Log format

{"message_id":"$message_id","project_id":"$project_id","topic_urn":"$topic_urn","subscriber_urn":"$subscriber_urn","protocol_name":"$protocol_name","endpoint":"$endpoint","status":"$status","http_code":$http_code,"create_time":"$create_time","send_time":"$send_time"}

The log format cannot be modified. Table 1 describes the log fields.

Table 1 Parameters in a FunctionGraph (function) message

Parameter

Type

Description

message_id

String

Message ID

project_id

String

Project ID

topic_urn

String

Resource identifier of a topic, which is unique

subscriber_urn

String

Resource identifier of a subscription, which is unique

protocol_name

String

Specifies the subscription protocol. (Different protocols indicate different types of endpoints to receive messages.) The following protocols are supported:

Email: The endpoints are email addresses.

SMS: The endpoints are phone numbers.

FunctionGraph: FunctionGraph (function) transmission protocol. The endpoint is a function.

FunctionStage: FunctionStage (workflow) transmission protocol. The endpoint is a function workflow.

HTTP and HTTPS: The endpoints are URLs.

endpoint

String

Message receiving endpoint

status

String

Message status. The options are as follows:

DELIVERED: The message has been delivered.

FAIL_DELIVERED: The message fails to be sent.

REJECTS: The message has been rejected. The flow control mechanism is triggered.

http_code

Integer

HTTP return code. Only HTTP/HTTPS messages are supported.

create_time

String

Time when a message was created. The UTC time is in YYYY-MM-DDTHH:MM:SSZ format.

send_time

String

Specifies the time when the message was sent. The UTC time is in YYYY-MM-DDTHH:MM:SSZ format.

Example Log

{"message_id":"1ae49922602a42fc83acb9689a2eb5f4","project_id":"5a9f32e4f1ec4bbe9695ff9da51c2925","topic_urn":"urn:smn:regionid:5a9f32e4f1ec4bbe9695ff9da51c2925:demo","subscriber_urn":"urn:smn:regionid:5a9f32e4f1ec4bbe9695ff9da51c2925:demo:b55c3c6fa7cd471b9f24818d530a8740","protocol_name":"https","endpoint":"https://127.0.0.1:443/https","status":"DELIVERED","http_code":200,"create_time":"2022-11-01T00:00:00Z","send_time":"2022-11-01T00:00:10Z"}

The following table describes the fields in the log.

Table 2 Example values of fields in the log

Parameter

Example Value

message_id

1ae49922602a42fc83acb9689a2eb5f4

project_id

5a9f32e4f1ec4bbe9695ff9da51c2925

topic_urn

urn:smn:regionid:5a9f32e4f1ec4bbe9695ff9da51c2925:demo

subscriber_urn

urn:smn:regionid:5a9f32e4f1ec4bbe9695ff9da51c2925:demo:b55c3c6fa7cd471b9f24818d530a8740

protocol_name

https

endpoint

https://127.0.0.1:443/https

status

DELIVERED

http_code

200

create_time

2022-11-01T00:00:00Z

send_time

2022-11-01T00:00:10Z

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback