logs-java

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

PostHog logs for Java

Java 应用的 PostHog 日志集成

This skill helps you add PostHog log ingestion to Java applications.
本技能可帮助你为 Java 应用添加 PostHog 日志采集功能。

Reference files

参考文档

  • references/java.md
    - Java logs installation - docs
  • references/start-here.md
    - Getting started with logs - docs
  • references/search.md
    - Search logs - docs
  • references/best-practices.md
    - Logging best practices - docs
  • references/troubleshooting.md
    - Logs troubleshooting - docs
  • references/link-session-replay.md
    - Link session replay - docs
  • references/debug-logs-mcp.md
    - Debug logs with mcp - docs
Consult the documentation for API details and framework-specific patterns.
  • references/java.md
    - Java 日志安装文档
  • references/start-here.md
    - 日志快速入门文档
  • references/search.md
    - 日志搜索文档
  • references/best-practices.md
    - 日志最佳实践文档
  • references/troubleshooting.md
    - 日志故障排查文档
  • references/link-session-replay.md
    - 会话重放关联文档
  • references/debug-logs-mcp.md
    - 使用 MCP 调试日志文档
如需了解 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.
暂无特定框架指南。