PostHog / PostHog/posthog-php

Add structured Logs / OTLP log capture support

Open
#179 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement team/logs
Dominant language
PHP
Stars
33
Forks
34
Avg merge
2d 4h
Merged PRs (30d)
13

Description

Summary

Add structured Logs / OTLP log capture support to the PHP SDK.

Spec

  • sdk-specs/openspec/specs/logs/spec.md

Current evidence

The SDK audit found no captureLog, logger helper, OTLP encoding, log batcher, or /i/v1/logs transport.

Expected behavior

Implement the canonical logs behavior, including:

  • Public log capture API / logger helper.
  • Severity mapping.
  • OTLP log record/envelope encoding.
  • Batching/flush behavior for logs.
  • Transport to {host}/i/v1/logs?token={projectApiKey}.
  • Tests for core spec scenarios.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read sdk-specs/openspec/specs/logs/spec.md first, then locate the PHP SDK entry points for public capture, severity handling, batching, transport, and tests. Done means the SDK implements the canonical log behavior, sends OTLP data to /i/v1/logs?token={projectApiKey}, and covers the core specification scenarios.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.