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
Situation Awareness
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
Help Center/ Log Tank Service/ Best Practices/ Log Ingestion/ Collecting Logs from Multiple Channels to LTS

Collecting Logs from Multiple Channels to LTS

Updated on 2025-01-14 GMT+08:00

Log ingestion is the process of collecting log data generated during the running of applications or services and storing the data to specified locations for subsequent analysis and use. Log data includes system running status, error information, and user operation records. Log data is important for system O&M, troubleshooting, and service analysis.

LTS enables real-time log ingestion via various methods. Logs can be collected using ICAgent, ingested from cloud services, or reported to LTS via custom software, APIs, or SDKs, meeting requirements in different scenarios.

  • More than 40 Huawei Cloud services
  • Web, iOS, Android, and applets
  • Open-source software, such as Logstash, Flume, and Beats
  • Standard protocols, such as HTTP, HTTPS, syslog, and Kafka

Applications Scenarios

This practice uses a food take-out and delivery platform as an example. This platform allows order foods via websites, apps, WeChat, and Alipay. Once restaurants confirm and prepare the orders, the platform notifies nearby delivery drivers, who then deliver the foods to customers.

During data-based operations, data collection is challenging for the following reasons:

  • Multiple channels: Data is scattered across channels, including advertisers and promoters.
  • Various devices: Data comes from websites, official accounts, mobile phones, browsers (web and mobile pages), etc.
  • Heterogeneity: Data sources include VPCs, customer-built IDCs, and Huawei Cloud ECSs.
  • Multiple development languages: Different languages are used, with Java for the core system, Nginx for the frontend server, and C++ for the backend payment system.
  • Diverse architectures: Restaurant devices run on both x86 and Arm.

In this case, you can use LTS to collect internal and external logs for central management.

Centrally Managing Logs

  1. On the LTS console, create a log group. For details, see Managing Log Groups.
  2. Create log streams for logs generated by different data sources. For details, see Managing Log Streams. The following log streams are for reference only.
    • wechat-server for storing WeChat server access logs
    • wechat-app for storing WeChat server application logs
    • wechat-error for storing error logs
    • alipay-server
    • alipay-app
    • deliver-app for storing the app statuses of delivery drivers
    • deliver-error for storing error logs
    • web-click for storing logs of HTML5 page clicks
    • server-access for storing server-side access logs
    • server-app for storing server application logs
    • coupon for storing application coupon logs
    • pay for storing payment logs
    • order for storing order logs

Collecting Promotion Logs

Restaurants usually use the following promotion ways:

  • Issue coupons when customers sign up.
  • Distribute coupons via QR codes on flyers, web pages or other channels.

Before promotion, set the following registration server address to generate a QR code for flyers or web pages. When a customer scans the QR code for registration, the platform recognizes that the customer is accessing it from the specific source and records a log.

http://example.com/login?source=10012&ref=kd4b

When the server side receives a request, the server generates a log like the following one:

2024-06-20 19:00:00 e41234ab342ef034,102345,5k4d,467890

Promotion logs can be collected in the following ways:

Collecting Device User Logs

LTS collects logs from various devices, including web browsers, iOS, Android, Baidu applets, WeChat applets, DingTalk applets, and quick apps. You can quickly integrate LTS's mobile SDKs to your devices to enable functions such as cache sending, retry upon exceptions, and batch sending.

Collection solution:

  • Mobile devices: Use iOS and Android SDKs to ingest logs.
  • Arm devices: Use Native C for cross compilation.
  • Restaurant devices: Use SDKs for x86 devices, and Native C for cross compilation for Arm devices.

You can use the following methods to collect device user logs:

  • Create a log collection task to write logs to a specified log stream.
  • Ingest CCE logs to LTS to collect logs generated in Docker. For details, see Ingesting CCE Application Logs to LTS.
  • Use SDKs to write C#, Python, Java, PHP, and C logs into LTS. For details, see SDK Overview.

Collecting Server Logs

The following server logs are for reference only.

  • Syslog logs
    Aug 31 11:07:24 zhouqi-mac WeChat[9676]: setupHotkeyListenning event NSEvent: type=KeyDown loc=(0,703) time=115959.8 flags=0 win=0x0 winNum=7041 ctxt=0x0 chars="u" unmodchars="u" repeat=0 keyCode=32
  • Application debug logs
    __FILE__:build/release64/sls/shennong_worker/ShardDataIndexManager.cpp
    __LEVEL__:WARNING
    __LINE__:238
    __THREAD__:31502
    offset:816103453552
    saved_cursor:1469780553885742676
    seek count:62900
    seek data redo
    log:pangu://localcluster/redo_data/41/example/2016_08_30/250_1472555483
    user_cursor:1469780553885689973
  • Trace logs
    [2013-07-13 10:28:12.772518]    [DEBUG] [26064]  __TRACE_ID__:661353951201    __item__:[Class:Function]_end__  request_id:1734117   user_id:124 context:.....

You can use the following methods to collect server logs:

  • Create a log collection task to write logs to a specified log stream.
  • Ingest CCE logs to LTS to collect logs generated in Docker. For details, see Ingesting CCE Application Logs to LTS.
  • Use SDKs to write C#, Python, Java, PHP, and C logs into LTS. For details, see SDK Overview.

Collecting Logs from Various Network Environments

LTS provides access points in each region, enabling three access methods:

  • Intranet (classic network): Cloud services in the same region as LTS can access LTS via the intranet, which features high-bandwidth links and is the recommended method.
  • Public network (classic network): Any access is allowed. The access speed depends on the link quality. In this case, HTTPS is recommended for transmission security.
  • Private network (VPC): Cloud services in the same region as LTS can access LTS through VPCs.

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