logs-go
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePostHog logs for Go
适用于Go语言的PostHog日志集成
This skill helps you add PostHog log ingestion to Go applications.
本技能可帮助你在Go应用中添加PostHog日志收集功能。
Reference files
参考文档
- - Go logs installation - docs
references/go.md - - Getting started with logs - docs
references/start-here.md - - Search logs - docs
references/search.md - - Logging best practices - docs
references/best-practices.md - - Logs troubleshooting - docs
references/troubleshooting.md - - Link session replay - docs
references/link-session-replay.md - - Debug logs with mcp - docs
references/debug-logs-mcp.md
Consult the documentation for API details and framework-specific patterns.
- - Go日志安装文档
references/go.md - - 日志入门文档
references/start-here.md - - 日志搜索文档
references/search.md - - 日志最佳实践文档
references/best-practices.md - - 日志故障排查文档
references/troubleshooting.md - - 会话重放关联文档
references/link-session-replay.md - - 基于MCP的调试日志文档
references/debug-logs-mcp.md
如需了解API详情和特定框架的实现模式,请查阅上述文档。
Key principles
核心原则
- Environment variables: Always use environment variables for PostHog keys and OpenTelemetry endpoints. Never hardcode them.
- Minimal changes: Add log export alongside existing logging. Don't replace or restructure existing logging code.
- OpenTelemetry: PostHog logs use the OpenTelemetry protocol. Configure an OTLP exporter pointed at PostHog's ingest endpoint.
- Structured logging: Prefer structured log formats with key-value properties over plain text messages.
- 环境变量:PostHog密钥和OpenTelemetry端点始终使用环境变量配置,切勿硬编码。
- 最小改动:在现有日志系统基础上添加日志导出功能,请勿替换或重构现有日志代码。
- OpenTelemetry:PostHog日志采用OpenTelemetry协议,需配置指向PostHog收集端点的OTLP导出器。
- 结构化日志:优先使用带键值属性的结构化日志格式,而非纯文本消息。
Framework guidelines
框架指南
No specific framework guidelines.
无特定框架指南。