
Research
/Security News
Fake imToken Chrome Extension Steals Seed Phrases via Phishing Redirects
Mixed-script homoglyphs and a lookalike domain mimic imToken’s import flow to capture mnemonics and private keys.
trpc.group/trpc-go/trpc-log-cls
Advanced tools
English | 中文
This plugin encapsulates the Tencent Cloud CLS SDK and provides a tRPC-Go logging plugin to quickly integrate your tRPC-Go service with the CLS logging system.
plugins:
log: # Logging configuration, supports multiple logs, can log using log.Get("xxx").Debug
default: # Default log configuration, multiple outputs are supported for each log
- writer: cls # CLS remote log output
level: debug # Log level for remote logging
remote_config: # Remote log configuration
topic_id: b0179d73-8932-4a96-a1df-xxxxxx # CLS log topic ID
host: ap-guangzhou.cls.tencentyun.com # CLS log reporting domain
secret_id: AKIDRefNpzzYcOf7HFsj8Kxxxxxxx # Tencent Cloud secret_id
secret_key: jK4ZJIMEuV3IHy49zYq2yxxxxxxx # Tencent Cloud secret_key
total_size_ln_bytes: 104857600 # [Optional, 100 * 1024 * 1024] Maximum log size that the instance can cache
max_send_worker_count: 50 # [Optional, 50] Maximum number of "goroutines" for concurrency
max_block_sec: 0 # [Optional, 0] Maximum blocking time on the send method, default is 0 (non-blocking)
max_batch_size: 5242880 # [Optional, 5 * 1024 * 1024] When the log size cached in the Batch is greater than or equal to MaxBatchSize, the batch will be sent
max_batch_count: 4096 # [Optional, 4096] When the number of logs cached in the Batch is greater than or equal to MaxBatchCount, the batch will be sent
linger_ms: 2000 # [Optional, 2 * 1000] The time from batch creation to being able to send
retries: 10 # [Optional, 10] Number of retries for a batch that failed to send for the first time
max_reserved_attempts: 11 # [Optional, 11] Each attempt to send a batch corresponds to an attempt, and this parameter controls the number of attempts returned to the user
base_retry_backoff_ms: 100 # [Optional, 100] Backoff time for the first retry
max_retry_backoff_ms: 50000 # [Optional, 50 * 1000] Maximum backoff time for retries
source: 127.0.0.1 # [Optional] Default to using trpc global local_ip, service listening IP
field_map: # [Optional, not set by default] Custom field mapping for reporting
Level: log_level # Map the Level field to log_level and report it
field1: test_field # Map the field1 field to test_field and report it
import _ "trpc.group/trpc-go/trpc-log-cls"
log.WithFields("key1", "value1").Info("message1")
log.Warn("warning message1")
field_map: # [Optional, not set by default] Custom field mapping for reporting
Msg: log_content # Map the Msg field to log_content and report it
Caller: file_line # Map the Caller field to file_line and report it
Level: log_level # Map the Level field to log_level and report it
Time: ts # Map the Time field to ts and report it
key1: test_field # Map the key1 field to test_field and report it
...
If you need more complex field remapping or filtering, you can implement it by overriding cls.GetReportCLSField. For example, to standardize the fields reported to remote logging in lowercase with underscores:
import (
...
cls "trpc.group/trpc-go/trpc-log-cls"
...
)
func init() {
cls.GetReportCLSField = func(sourceField string, _ *cls.Config) (string, bool) {
var output []rune
for i, r := range sourceField {
if i == 0 {
output = append(output, unicode.ToLower(r))
continue
}
if unicode.IsUpper(r) {
output = append(output, '_')
}
output = append(output, unicode.ToLower(r))
}
return string(output), true
}
}
FAQs
Unknown package
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Mixed-script homoglyphs and a lookalike domain mimic imToken’s import flow to capture mnemonics and private keys.

Security News
Latio’s 2026 report recognizes Socket as a Supply Chain Innovator and highlights our work in 0-day malware detection, SCA, and auto-patching.

Company News
Join Socket for live demos, rooftop happy hours, and one-on-one meetings during BSidesSF and RSA 2026 in San Francisco.