golang-samber-slog
Build Go Logging Pipelines with samber/slog
Complex Go logging pipelines can duplicate records, lose buffered events, or expose sensitive data. This skill guides composition, sampling, formatting, middleware, routing, and shutdown.
使用我的智能体安装
将此请求复制给你的智能体,其中包含权威 Skill 页面和清单。
Review the Skillstore skill "golang-samber-slog" from https://skillstore.io/skills/samber-golang-samber-slog.md and its manifest at https://skillstore.io/api/skills/samber-golang-samber-slog/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.你的智能体仍应展示其计划,并按安全策略请求必要确认。
Agent 可读资源
当 AI Agent、爬虫或脚本需要干净上下文,而不是读取完整页面时,请使用这些链接。
测试它
正在使用“golang-samber-slog”。 Why do error records reach both PagerDuty and Slack in my Router?
预期结果:
The default Router sends each record to every matching handler. Use FirstMatch and order the error rule before the warning rule.
正在使用“golang-samber-slog”。 Where should sampling and PII formatting appear in my pipeline?
预期结果:
Place sampling first, then apply PII formatting, then route clean records to sinks. Preserve important records with level-aware routing.
正在使用“golang-samber-slog”。 Why are buffered Loki records missing during shutdown?
预期结果:
The Loki client must stop during graceful shutdown. Register its stop operation and allow enough time to flush pending records.
安全审计
中风险All 69 static alerts are false positives caused by Markdown, Go syntax, placeholders, documentation links, or benign logging terminology. One medium contextual risk remains because examples enable request-body logging without sensitive-data guidance.
已确认安全问题 (1)
风险因素
⚙️ 外部命令 (50)
🌐 网络访问 (8)
⚡ 包含脚本 (1)
分享与引用此报告
分享版本化评估报告、中性徽章、嵌入卡片和引用。Skillstore 只报告证据,不判断该 Skill 是否安全。
复制报告链接
https://skillstore.io/skills/samber-golang-samber-slog/audits/1?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/samber-golang-samber-slog?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/samber-golang-samber-slog?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/samber-golang-samber-slog/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/samber-golang-samber-slog.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>学术引用 (APA · BibTeX · CFF)
APA 引用
samber. (2026). golang-samber-slog security audit report (audit version 1) [Author version 1.1.2]. Skillstore. https://skillstore.io/skills/samber-golang-samber-slog/audits/1BibTeX 引用
@techreport{samber-samber-golang-samber-slog-2026,
author = {samber},
title = {golang-samber-slog security audit report (audit version 1)},
institution = {Skillstore},
year = {2026},
number = {1},
url = {https://skillstore.io/skills/samber-golang-samber-slog/audits/1},
note = {Author version 1.1.2}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "golang-samber-slog security audit report (audit version 1)"
version: "1.1.2"
type: report
authors:
- name: "samber"
date-released: "2026-09-06"
url: "https://skillstore.io/skills/samber-golang-samber-slog/audits/1"
identifiers:
- type: other
value: "skillstore:samber-golang-samber-slog:audit:1"
description: "Skillstore immutable audit report identifier"
Skillstore 评分
评分依据 证据置信度: 中你能构建什么
Compose a service logging pipeline
Create a pipeline that samples noise, masks sensitive attributes, and routes records by level.
Standardize HTTP request logs
Configure framework middleware with consistent levels, request identifiers, tracing fields, and filters.
Diagnose production logging behavior
Find dropped records, duplicate routing, latency bottlenecks, and missing shutdown flushes.
试试这些提示
Create a Go slog pipeline using samber/slog-multi. Send error records to Sentry and all records to standard output.
Add threshold sampling and PII formatting to my existing slog pipeline. Explain the handler order and preserve all error records.
Configure slog middleware for Gin with distinct 4xx and 5xx levels, request IDs, tracing fields, and health-check filters. Keep body logging disabled.
Review my samber/slog pipeline for duplicate routing, latency, data exposure, fallback behavior, and shutdown loss. Propose tested changes with tradeoffs.
最佳实践
- Sample early, format sensitive attributes before routing, and define a catch-all route.
- Benchmark handler latency and test routing with in-memory handlers before deployment.
- Flush buffered backends during graceful shutdown and verify failures are observable.
避免
- Do not enable request or response body logging without redaction and route exclusions.
- Do not assume Router stops after the first matching handler.
- Do not use synchronous Fanout when cumulative sink latency is unacceptable.
常见问题
Which Go versions does this skill target?
Can it configure multiple logging destinations?
Does it prevent sensitive data from entering logs?
Does it install Go packages automatically?
Can it validate a production pipeline?
Why must buffered handlers stop cleanly?
开发者详情
作者
samber许可证
MIT
作者版本
v1.1.2
Skillstore 修订
r1
引用
e5464e662405de6361fdde6b984f9ea865635f64
维护新鲜度
2026/9/8
使用量
1 次下载 · 0 次浏览