Simple Log Service (SLS) provides SDKs for various programming languages, such as .NET Core, Java, Python, PHP, Node.js, C, Go, iOS, Android, and C++. You can use these SDKs to collect, query, and analyze logs.
Before you begin
The implementation details of the Simple Log Service SDK vary by language. However, all SDKs are wrappers for the Simple Log Service API and provide similar features. These features include the following:
Encapsulates Simple Log Service API operations. This eliminates the need to manage the details of API request creation and response parsing. The operations are similar across different languages, which makes it easy to switch between them. For more information, see API specifications.
Handles the digital signature logic for the Simple Log Service API. This simplifies API calls by eliminating the need to manage signature details. For more information, see Request signatures.
Encapsulates logs in the Protocol Buffers (Protobuf) format. This eliminates the need to manage the details of the Protobuf format when you write logs. For more information, see Protobuf format.
Implements the compression methods defined in the Simple Log Service API. This eliminates the need to manage the details of the compression implementation. The SDKs for some languages support writing logs in compressed mode. This mode is enabled by default.
Provides a unified error handling mechanism. This lets you handle request exceptions in a way that is familiar to the programming language. For more information, see Error handling mechanism.
All current SDKs support only synchronous requests.
SDK list
The following table lists the reference documents and GitHub source code for the Simple Log Service SDKs for different languages.
Simple Log Service sets reasonable limits on basic resources, such as the number of projects, Logstores, shards, and the size of a LogItem. Before you use an SDK, read the limits document to understand these restrictions. For more information, see Limits on basic resources.
After you collect logs to Simple Log Service using an SDK, you must also configure appropriate indexes for the logs. Then, you can perform operations such as log query and analysis, and data transformation. For more information, see Create an index and Quick guide to query and analysis.
SDK language | Reference | GitHub source code |
Java | ||
.NET Core | ||
PHP | ||
Python | ||
Node.js | ||
C | ||
GO | ||
iOS | ||
Android | ||
C++ | ||
HarmonyOS |