Vercel logs

Vercel logs

Capture Vercel deployment logs as PostHog events

Configuration

OptionDescription
Authorization header value
Type: string
Required: False

If set, the incoming Authorization header must match this value exactly. e.g. "Bearer SECRET_TOKEN"

Max message length
Type: number
Required: False

Truncate log messages longer than this (default: 262144 bytes)

Log payloads
Type: boolean
Required: False

Logs the incoming request for debugging

Distinct ID salt
Type: string
Required: False

High-entropy random secret (e.g. base64) mixed into hashed distinct IDs. Rotate to invalidate prior IDs. Used by rotating_salt, fixed_salt, and the rotating_salt_fallback path of custom; ignored by the ip strategy. If left blank, hashed strategies still produce stable IDs but lose the unguessability the salt provides — set one in production.

Distinct ID strategy
Type: choice
Required: True

How distinct IDs are derived. Default rotates daily so the same client gets a fresh ID each day. The active strategy is recorded on each event as $distinct_id_strategy for debugging.

Forward client IP and user agent
Type: boolean
Required: False

When enabled (default), $ip, $raw_user_agent, proxy_client_ip, and proxy_user_agent are emitted on each event so PostHog can run GeoIP and user-agent enrichment. Disable if you want raw client identifiers stripped — distinct_id derivation still uses them as inputs, but they will not appear on the emitted event.

Custom distinct ID template
Type: string
Required: False

Used only when strategy is "custom". Supports placeholders {day}, {ip}, {host}, {ua}, {path}, {project_id} (literal string substitution, not Hog evaluation; unknown placeholders are left as-is). The salt secret is intentionally not exposed as a placeholder. The result is prefixed with "http_log_". Empty value or all-empty substitutions fall back to rotating_salt.

Using our REST API you can create this source_webhook like so:

Terminal
# Create a new destination
curl --location 'https://us.i.posthog.com/api/environments/:project_id/hog_functions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <POSTHOG_PERSONAL_API_KEY>' \
--data '{
"type": "source_webhook",
"name": "Vercel logs",
"inputs": {
"distinct_id_strategy": {
"value": ""
}
},
"enabled": true,
"template_id": "template-source-vercel-log-drain"
}'

Community questions

Questions about this page? or post a community question.