Use the C Producer SDK to collect logs from embedded and smart devices with minimal resource overhead.
Simple Log Service C Producer is a log collection agent written in pure C. It has minimal dependencies and low resource consumption, making it ideal for embedded and smart devices.
Features
-
Asynchronous writing
-
Writes logs asynchronously without blocking agent threads.
-
-
Log aggregation and compression
-
Aggregates logs by timeout, count, or size before upload.
-
Compresses logs with LZ4 before upload.
-
-
Contextual query
-
Logs from the same device share a context, enabling before-and-after log queries in Simple Log Service.
-
-
Concurrent sending
-
Sends logs concurrently through a configurable thread pool.
-
-
Caching
-
Caches logs up to a configurable limit. New writes are rejected when the limit is reached.
-
-
Custom identifier
-
Logs include IP addresses by default.
-
Supports custom tags and topics.
-
Benefits
-
Writes hundreds of thousands of logs per second to Simple Log Service using a configurable thread pool. Performance test.
-
Low resource consumption: 30% CPU at 200,000 logs per second. Resources are not affected at 100 logs per second on low-performance hardware such as Raspberry Pi. Performance test.
-
Sends logs directly to Simple Log Service without local storage.
-
Isolates computing from I/O: asynchronous writes do not block worker threads.
-
Stores logs on program exit and sends them on restart to ensure data reliability. Solution to reliable program exit.
Version selection
Select a version based on your device type and scenario.
|
Version |
Status |
Benefit |
Recommended scenario |
|
master |
Available |
The original lite version. Simpler dependencies, lower resource usage, and higher performance than v1 (1.0f). Best overall performance. Recommended. |
Linux servers and embedded Linux devices. |
|
live |
Available |
Same features as master. Supports the widest range of platforms: Windows, macOS, Android, and iOS. |
Platforms where master is not supported. |
|
bricks |
Available |
Ultra-compact with minimal binary and memory footprint. Limited performance. Use when resources are constrained. |
Resource-constrained environments under 10 KB, such as RTOS devices. |
|
persistent |
Available |
Adds local caching to master. Used in native Android and iOS implementations. Limits sending to a single thread. Not recommended for direct use with Simple Log Service. |
Use official Android and iOS SDKs instead. |
Download and installation
Download the source code and install C Producer from GitHub: