Collection Methods

Last updated: 2019-11-25 15:50:22

PDF

Collection methods

CLS provides multiple collection methods:

Collection method Description
Collect logs via API You can upload structured logs to CLS by calling CLS API. For more information, see Uploading Structured Logs.
Collect logs via SDK Collecting via SDK is not supported at this time.
Collect logs via LogListener client LogListener is a log collection client provided by CLS. You can quickly access CLS by simply configuring LogListener on the console. For more information, see LogListener Use Process.

A comparison of the collection methods is as follows:

Category name Collection by LogListener Collection via API
Code modification Provides a non-intrusive collection method for applications, without code modification. Reports logs only after modifying application code.
Resumable upload Supports resumable upload of logs. Automatically implemented by code.
Retransmission upon failure Provides an inherent retry mechanism. Automatically implemented by code.
Local cache Supports local cache, ensuring data integrity during peak hours. Automatically implemented by code.
Resource occupation Occupies resources such as memory and CPU. Occupies no additional resources.

Accessing log sources

You can access different log sources in different ways. For more information, see the following tables:

Log source category

Log source category Recommended access method
Direct program output API
Local log file LogListener

Log source environment

System environment Recommended access method
Linux/Unix LogListener
Windows API (Currently, LogListener does not support Windows.)
iOS/Android API (Currently, no iOS/Android SDK is available.)

Cloud product logs

Cloud product name Recommended access method
Cloud Virtual Machine (CVM) Install and configure LogListener
API Gateway Console
Live Video Broadcasting (LVB) Console
Serverless Cloud Function (SCF) Console (For more information, see the access instructions.)
Tencent Kubernetes Engines (TKE) Console (For more information, see the access guide.)
Flow Logs (FLs) Console