From 9999d6794480fbc73c135ef05630f3034fdaa329 Mon Sep 17 00:00:00 2001 From: "inkeep[bot]" <257615677+inkeep[bot]@users.noreply.github.com> Date: Thu, 4 Jun 2026 22:45:33 +0000 Subject: [PATCH] docs(logs): document UI settings panel for person pivot attribute key PR #61301 adds a settings UI at Environment > Logs > "Link to person" for configuring the logs_distinct_id_attribute_key (admin-only), plus a gear icon shortcut from the person Logs tab. Update the "Customizing the attribute key" section to mention the UI method first and present the API as an alternative. --- contents/docs/logs/link-person.mdx | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/contents/docs/logs/link-person.mdx b/contents/docs/logs/link-person.mdx index 3ec01e10e9c8..0e7e2e99d0c4 100644 --- a/contents/docs/logs/link-person.mdx +++ b/contents/docs/logs/link-person.mdx @@ -35,24 +35,24 @@ When you emit logs directly via OpenTelemetry from a backend — Python, Go, Nod ```javascript file=JavaScript -import { logs } from '@opentelemetry/api-logs' +import { logs } from "@opentelemetry/api-logs"; -const logger = logs.getLogger('my-app') +const logger = logs.getLogger("my-app"); -app.post('/api/checkout', async (req, res) => { - const userId = req.userId // ... get your user ID +app.post("/api/checkout", async (req, res) => { + const userId = req.userId; // ... get your user ID logger.emit({ - severityText: 'info', - body: 'Checkout completed', + severityText: "info", + body: "Checkout completed", attributes: { - posthogDistinctId: userId, // Links to PostHog person - orderId: 'A-123', + posthogDistinctId: userId, // Links to PostHog person + orderId: "A-123", }, - }) + }); - res.json({ success: true }) -}) + res.json({ success: true }); +}); ``` ```python file=Python @@ -105,7 +105,11 @@ If the log does not appear, check: ## Customizing the attribute key -If your pipeline emits the person identifier under a different key (for example `user.id`, `customerId`, or a legacy `distinct_id`), point PostHog at that key with the `logs_config` endpoint: +If your pipeline emits the person identifier under a different key (for example `user.id`, `customerId`, or a legacy `distinct_id`), you can change it in [**Settings** > **Logs**](https://app.posthog.com/settings/environment-logs#logs-distinct-id-attribute-key) under **Link to person**. This setting requires admin access. + +You can also reach this setting from the gear icon on any person's **Logs** tab. + +Alternatively, update it via the API: ```bash curl -X PATCH "https://app.posthog.com/api/projects//logs_config/" \