[{"data":1,"prerenderedAt":2638},["ShallowReactive",2],{"navigation_docs":3,"-adapters-cloud-posthog":392,"-adapters-cloud-posthog-surround":2633},[4,35,159,201,289,376],{"title":5,"path":6,"stem":7,"children":8,"page":34},"Getting Started","\u002Fgetting-started","1.getting-started",[9,14,19,24,29],{"title":10,"path":11,"stem":12,"icon":13},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction","i-lucide-info",{"title":15,"path":16,"stem":17,"icon":18},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation","i-lucide-download",{"title":20,"path":21,"stem":22,"icon":23},"Quick Start","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start","i-lucide-zap",{"title":25,"path":26,"stem":27,"icon":28},"Agent Skills","\u002Fgetting-started\u002Fagent-skills","1.getting-started\u002F4.agent-skills","i-lucide-sparkles",{"title":30,"path":31,"stem":32,"icon":33},"vs Other Loggers","\u002Fgetting-started\u002Fvs-other-loggers","1.getting-started\u002F5.vs-other-loggers","i-lucide-scale",false,{"title":36,"path":37,"stem":38,"children":39,"page":34},"Logging","\u002Flogging","2.logging",[40,45,50,55,60,65,70,99,127],{"title":41,"path":42,"stem":43,"icon":44},"Overview","\u002Flogging\u002Foverview","2.logging\u002F0.overview","i-lucide-list",{"title":46,"path":47,"stem":48,"icon":49},"Simple Logging","\u002Flogging\u002Fsimple-logging","2.logging\u002F1.simple-logging","i-lucide-terminal",{"title":51,"path":52,"stem":53,"icon":54},"Wide Events","\u002Flogging\u002Fwide-events","2.logging\u002F2.wide-events","i-lucide-layers",{"title":56,"path":57,"stem":58,"icon":59},"Structured Errors","\u002Flogging\u002Fstructured-errors","2.logging\u002F3.structured-errors","i-lucide-shield-alert",{"title":61,"path":62,"stem":63,"icon":64},"Catalogs","\u002Flogging\u002Fcatalogs","2.logging\u002F4.catalogs","i-lucide-book-open",{"title":66,"path":67,"stem":68,"icon":69},"Client Logging","\u002Flogging\u002Fclient-logging","2.logging\u002F5.client-logging","i-lucide-monitor",{"title":71,"icon":72,"path":73,"stem":74,"children":75,"page":34},"AI SDK","i-simple-icons-vercel","\u002Flogging\u002Fai-sdk","2.logging\u002F6.ai-sdk",[76,79,84,89,94],{"title":41,"path":77,"stem":78,"icon":44},"\u002Flogging\u002Fai-sdk\u002Foverview","2.logging\u002F6.ai-sdk\u002F01.overview",{"title":80,"path":81,"stem":82,"icon":83},"Usage","\u002Flogging\u002Fai-sdk\u002Fusage","2.logging\u002F6.ai-sdk\u002F02.usage","i-lucide-code",{"title":85,"path":86,"stem":87,"icon":88},"Options","\u002Flogging\u002Fai-sdk\u002Foptions","2.logging\u002F6.ai-sdk\u002F03.options","i-lucide-sliders",{"title":90,"path":91,"stem":92,"icon":93},"Metadata","\u002Flogging\u002Fai-sdk\u002Fmetadata","2.logging\u002F6.ai-sdk\u002F04.metadata","i-lucide-database",{"title":95,"path":96,"stem":97,"icon":98},"Telemetry","\u002Flogging\u002Fai-sdk\u002Ftelemetry","2.logging\u002F6.ai-sdk\u002F05.telemetry","i-lucide-activity",{"title":100,"icon":101,"path":102,"stem":103,"children":104,"page":34},"Better Auth","i-simple-icons-betterauth","\u002Flogging\u002Fbetter-auth","2.logging\u002F7.better-auth",[105,108,113,118,122],{"title":41,"path":106,"stem":107,"icon":44},"\u002Flogging\u002Fbetter-auth\u002Foverview","2.logging\u002F7.better-auth\u002F01.overview",{"title":109,"path":110,"stem":111,"icon":112},"Identify User","\u002Flogging\u002Fbetter-auth\u002Fidentify-user","2.logging\u002F7.better-auth\u002F02.identify-user","i-lucide-user-check",{"title":114,"path":115,"stem":116,"icon":117},"Middleware","\u002Flogging\u002Fbetter-auth\u002Fmiddleware","2.logging\u002F7.better-auth\u002F03.middleware","i-lucide-shield",{"title":119,"path":120,"stem":121,"icon":69},"Client Sync","\u002Flogging\u002Fbetter-auth\u002Fclient-sync","2.logging\u002F7.better-auth\u002F04.client-sync",{"title":123,"path":124,"stem":125,"icon":126},"Performance","\u002Flogging\u002Fbetter-auth\u002Fperformance","2.logging\u002F7.better-auth\u002F05.performance","i-lucide-gauge",{"title":128,"icon":129,"path":130,"stem":131,"children":132,"page":34},"Audit Logs","i-lucide-shield-check","\u002Flogging\u002Faudit","2.logging\u002F8.audit",[133,136,141,146,151,155],{"title":41,"path":134,"stem":135,"icon":44},"\u002Flogging\u002Faudit\u002Foverview","2.logging\u002F8.audit\u002F01.overview",{"title":137,"path":138,"stem":139,"icon":140},"Schema","\u002Flogging\u002Faudit\u002Fschema","2.logging\u002F8.audit\u002F02.schema","i-lucide-file-text",{"title":142,"path":143,"stem":144,"icon":145},"Recording","\u002Flogging\u002Faudit\u002Frecording","2.logging\u002F8.audit\u002F03.recording","i-lucide-pen-line",{"title":147,"path":148,"stem":149,"icon":150},"Drains","\u002Flogging\u002Faudit\u002Fpipeline","2.logging\u002F8.audit\u002F04.pipeline","i-lucide-link",{"title":152,"path":153,"stem":154,"icon":129},"Compliance","\u002Flogging\u002Faudit\u002Fcompliance","2.logging\u002F8.audit\u002F05.compliance",{"title":156,"path":157,"stem":158,"icon":64},"Recipes","\u002Flogging\u002Faudit\u002Frecipes","2.logging\u002F8.audit\u002F06.recipes",{"title":160,"path":161,"stem":162,"children":163,"page":34},"Core Concepts","\u002Fcore-concepts","3.core-concepts",[164,169,174,179,184,188,191,196],{"title":165,"path":166,"stem":167,"icon":168},"Lifecycle","\u002Fcore-concepts\u002Flifecycle","3.core-concepts\u002F0.lifecycle","i-lucide-arrow-right-left",{"title":170,"path":171,"stem":172,"icon":173},"Configuration","\u002Fcore-concepts\u002Fconfiguration","3.core-concepts\u002F1.configuration","i-lucide-settings",{"title":175,"path":176,"stem":177,"icon":178},"Sampling","\u002Fcore-concepts\u002Fsampling","3.core-concepts\u002F2.sampling","i-lucide-filter",{"title":180,"path":181,"stem":182,"icon":183},"Typed Fields","\u002Fcore-concepts\u002Ftyped-fields","3.core-concepts\u002F3.typed-fields","i-simple-icons-typescript",{"title":185,"path":186,"stem":187,"icon":129},"Best Practices","\u002Fcore-concepts\u002Fbest-practices","3.core-concepts\u002F4.best-practices",{"title":123,"path":189,"stem":190,"icon":126},"\u002Fcore-concepts\u002Fperformance","3.core-concepts\u002F5.performance",{"title":192,"path":193,"stem":194,"icon":195},"Vite Plugin","\u002Fcore-concepts\u002Fvite-plugin","3.core-concepts\u002F6.vite-plugin","i-custom-vite",{"title":197,"path":198,"stem":199,"icon":200},"Auto-Redaction","\u002Fcore-concepts\u002Fredaction","3.core-concepts\u002F7.redaction","i-lucide-eye-off",{"title":202,"path":203,"stem":204,"children":205,"page":34},"Frameworks","\u002Fframeworks","4.frameworks",[206,210,215,220,225,230,235,240,245,250,255,260,265,270,274,279,284],{"title":41,"path":207,"stem":208,"icon":209},"\u002Fframeworks\u002Foverview","4.frameworks\u002F00.overview","i-lucide-layout-grid",{"title":211,"path":212,"stem":213,"icon":214},"Nuxt","\u002Fframeworks\u002Fnuxt","4.frameworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":216,"path":217,"stem":218,"icon":219},"Next.js","\u002Fframeworks\u002Fnextjs","4.frameworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":221,"path":222,"stem":223,"icon":224},"SvelteKit","\u002Fframeworks\u002Fsveltekit","4.frameworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":226,"path":227,"stem":228,"icon":229},"Nitro","\u002Fframeworks\u002Fnitro","4.frameworks\u002F04.nitro","i-custom-nitro",{"title":231,"path":232,"stem":233,"icon":234},"TanStack Start","\u002Fframeworks\u002Ftanstack-start","4.frameworks\u002F05.tanstack-start","i-custom-tanstack",{"title":236,"path":237,"stem":238,"icon":239},"NestJS","\u002Fframeworks\u002Fnestjs","4.frameworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":241,"path":242,"stem":243,"icon":244},"Express","\u002Fframeworks\u002Fexpress","4.frameworks\u002F07.express","i-simple-icons-express",{"title":246,"path":247,"stem":248,"icon":249},"Hono","\u002Fframeworks\u002Fhono","4.frameworks\u002F08.hono","i-simple-icons-hono",{"title":251,"path":252,"stem":253,"icon":254},"Fastify","\u002Fframeworks\u002Ffastify","4.frameworks\u002F09.fastify","i-simple-icons-fastify",{"title":256,"path":257,"stem":258,"icon":259},"Elysia","\u002Fframeworks\u002Felysia","4.frameworks\u002F10.elysia","i-custom-elysia",{"title":261,"path":262,"stem":263,"icon":264},"React Router","\u002Fframeworks\u002Freact-router","4.frameworks\u002F11.react-router","i-custom-reactrouter",{"title":266,"path":267,"stem":268,"icon":269},"Cloudflare Workers","\u002Fframeworks\u002Fcloudflare-workers","4.frameworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":271,"path":272,"stem":273,"icon":183},"Standalone","\u002Fframeworks\u002Fstandalone","4.frameworks\u002F13.standalone",{"title":275,"path":276,"stem":277,"icon":278},"Astro","\u002Fframeworks\u002Fastro","4.frameworks\u002F14.astro","i-simple-icons-astro",{"title":280,"path":281,"stem":282,"icon":283},"AWS Lambda","\u002Fframeworks\u002Faws-lambda","4.frameworks\u002F16.aws-lambda","i-custom-lambda",{"title":285,"path":286,"stem":287,"icon":288},"Custom Integration","\u002Fframeworks\u002Fcustom-integration","4.frameworks\u002F17.custom-integration","i-lucide-puzzle",{"title":290,"path":291,"stem":292,"children":293,"page":34},"Adapters","\u002Fadapters","6.adapters",[294,297,337,352],{"title":41,"path":295,"stem":296,"icon":44},"\u002Fadapters\u002Foverview","6.adapters\u002F01.overview",{"title":298,"path":299,"stem":300,"children":301,"page":34},"Cloud destinations","\u002Fadapters\u002Fcloud","6.adapters\u002F02.cloud",[302,307,312,317,322,327,332],{"title":303,"path":304,"stem":305,"icon":306},"Axiom","\u002Fadapters\u002Fcloud\u002Faxiom","6.adapters\u002F02.cloud\u002F01.axiom","i-custom-axiom",{"title":308,"path":309,"stem":310,"icon":311},"OTLP","\u002Fadapters\u002Fcloud\u002Fotlp","6.adapters\u002F02.cloud\u002F02.otlp","i-simple-icons-opentelemetry",{"title":313,"path":314,"stem":315,"icon":316},"PostHog","\u002Fadapters\u002Fcloud\u002Fposthog","6.adapters\u002F02.cloud\u002F03.posthog","i-simple-icons-posthog",{"title":318,"path":319,"stem":320,"icon":321},"Sentry","\u002Fadapters\u002Fcloud\u002Fsentry","6.adapters\u002F02.cloud\u002F04.sentry","i-simple-icons-sentry",{"title":323,"path":324,"stem":325,"icon":326},"Better Stack","\u002Fadapters\u002Fcloud\u002Fbetter-stack","6.adapters\u002F02.cloud\u002F05.better-stack","i-simple-icons-betterstack",{"title":328,"path":329,"stem":330,"icon":331},"Datadog","\u002Fadapters\u002Fcloud\u002Fdatadog","6.adapters\u002F02.cloud\u002F06.datadog","i-simple-icons-datadog",{"title":333,"path":334,"stem":335,"icon":336},"HyperDX","\u002Fadapters\u002Fcloud\u002Fhyperdx","6.adapters\u002F02.cloud\u002F07.hyperdx","i-custom-hyperdx",{"title":338,"path":339,"stem":340,"children":341,"page":34},"Self-hosted","\u002Fadapters\u002Fself-hosted","6.adapters\u002F03.self-hosted",[342,347],{"title":343,"path":344,"stem":345,"icon":346},"File System","\u002Fadapters\u002Fself-hosted\u002Ffs","6.adapters\u002F03.self-hosted\u002F01.fs","i-lucide-hard-drive",{"title":348,"path":349,"stem":350,"icon":351},"NuxtHub","\u002Fadapters\u002Fself-hosted\u002Fnuxthub","6.adapters\u002F03.self-hosted\u002F02.nuxthub","i-simple-icons-nuxt",{"title":353,"path":354,"stem":355,"children":356,"page":34},"Building blocks","\u002Fadapters\u002Fbuilding-blocks","6.adapters\u002F04.building-blocks",[357,362,367,371],{"title":358,"path":359,"stem":360,"icon":361},"Pipeline","\u002Fadapters\u002Fbuilding-blocks\u002Fpipeline","6.adapters\u002F04.building-blocks\u002F01.pipeline","i-lucide-workflow",{"title":363,"path":364,"stem":365,"icon":366},"HTTP","\u002Fadapters\u002Fbuilding-blocks\u002Fhttp","6.adapters\u002F04.building-blocks\u002F02.http","i-lucide-globe",{"title":368,"path":369,"stem":370,"icon":83},"Custom Adapters","\u002Fadapters\u002Fbuilding-blocks\u002Fcustom","6.adapters\u002F04.building-blocks\u002F03.custom",{"title":372,"path":373,"stem":374,"icon":375},"Toolkit","\u002Fadapters\u002Fbuilding-blocks\u002Ftoolkit","6.adapters\u002F04.building-blocks\u002F04.toolkit","i-lucide-blocks",{"title":377,"path":378,"stem":379,"children":380,"page":34},"Enrichers","\u002Fenrichers","7.enrichers",[381,384,388],{"title":41,"path":382,"stem":383,"icon":28},"\u002Fenrichers\u002Foverview","7.enrichers\u002F1.overview",{"title":385,"path":386,"stem":387,"icon":288},"Built-in","\u002Fenrichers\u002Fbuilt-in","7.enrichers\u002F2.built-in",{"title":389,"path":390,"stem":391,"icon":83},"Custom","\u002Fenrichers\u002Fcustom","7.enrichers\u002F3.custom",{"id":393,"title":394,"body":395,"description":2619,"extension":2620,"links":2621,"meta":2629,"navigation":2630,"path":314,"seo":2631,"stem":315,"__hash__":2632},"docs\u002F6.adapters\u002F02.cloud\u002F03.posthog.md","PostHog Adapter",{"type":396,"value":397,"toc":2589},"minimark",[398,414,459,463,466,510,513,518,549,553,572,576,1154,1157,1160,1163,1197,1201,1255,1259,1266,1347,1351,1354,1411,1415,1491,1495,1505,1537,1541,1547,1586,1614,1618,1625,1638,1642,1648,1728,1742,1750,1754,1858,1862,1865,1953,1957,1963,1989,1993,2068,2071,2198,2202,2206,2215,2218,2222,2225,2245,2249,2255,2268,2272,2275,2394,2397,2557,2561,2585],[399,400,401,407,408,413],"p",{},[402,403,313],"a",{"href":404,"rel":405},"https:\u002F\u002Fposthog.com",[406],"nofollow"," is an open-source product analytics platform. The evlog PostHog adapter sends your wide events to ",[402,409,412],{"href":410,"rel":411},"https:\u002F\u002Fposthog.com\u002Fdocs\u002Flogs",[406],"PostHog Logs"," via the standard OTLP format, giving you a dedicated log viewer with filtering, search, and tail mode using your existing PostHog API key.",[415,416,419,422,447],"prompt",{":actions":417,"description":418,"icon":316},"[\"copy\",\"cursor\",\"windsurf\"]","Add the PostHog drain adapter",[399,420,421],{},"Add the PostHog drain adapter to send evlog wide events to PostHog Logs.",[423,424,425,429,432,435,438,441,444],"ol",{},[426,427,428],"li",{},"Identify which framework I'm using and follow its evlog integration pattern",[426,430,431],{},"Install evlog if not already installed",[426,433,434],{},"Import createPostHogDrain from 'evlog\u002Fposthog'",[426,436,437],{},"Wire createPostHogDrain() into my framework's drain configuration",[426,439,440],{},"Set POSTHOG_API_KEY environment variable",[426,442,443],{},"Optionally set POSTHOG_HOST for EU or self-hosted instances",[426,445,446],{},"Test by triggering a request and checking PostHog > Logs",[399,448,449,450,454,455],{},"Adapter docs: ",[402,451,452],{"href":452,"rel":453},"https:\u002F\u002Fwww.evlog.dev\u002Fadapters\u002Fcloud\u002Fposthog",[406],"\nFramework setup: ",[402,456,457],{"href":457,"rel":458},"https:\u002F\u002Fwww.evlog.dev\u002Fframeworks",[406],[460,461,15],"h2",{"id":462},"installation",[399,464,465],{},"The PostHog adapter comes bundled with evlog:",[467,468,474],"pre",{"className":469,"code":470,"filename":471,"language":472,"meta":473,"style":473},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { createPostHogDrain } from 'evlog\u002Fposthog'\n","src\u002Findex.ts","typescript","",[475,476,477],"code",{"__ignoreMap":473},[478,479,482,486,490,494,497,500,503,507],"span",{"class":480,"line":481},"line",1,[478,483,485],{"class":484},"s7zQu","import",[478,487,489],{"class":488},"sMK4o"," {",[478,491,493],{"class":492},"sTEyZ"," createPostHogDrain",[478,495,496],{"class":488}," }",[478,498,499],{"class":484}," from",[478,501,502],{"class":488}," '",[478,504,506],{"class":505},"sfazB","evlog\u002Fposthog",[478,508,509],{"class":488},"'\n",[460,511,20],{"id":512},"quick-start",[514,515,517],"h3",{"id":516},"_1-get-your-posthog-project-api-key","1. Get your PostHog project API key",[423,519,520,528,542],{},[426,521,522,523],{},"Log in to your ",[402,524,527],{"href":525,"rel":526},"https:\u002F\u002Fapp.posthog.com",[406],"PostHog dashboard",[426,529,530,531,535,536,535,539],{},"Go to ",[532,533,534],"strong",{},"Settings"," > ",[532,537,538],{},"Project",[532,540,541],{},"Project API Key",[426,543,544,545,548],{},"Copy the key (starts with ",[475,546,547],{},"phc_",")",[514,550,552],{"id":551},"_2-set-environment-variables","2. Set environment variables",[467,554,559],{"className":555,"code":556,"filename":557,"language":558,"meta":473,"style":473},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","POSTHOG_API_KEY=phc_your-project-api-key\n",".env","bash",[475,560,561],{"__ignoreMap":473},[478,562,563,566,569],{"class":480,"line":481},[478,564,565],{"class":492},"POSTHOG_API_KEY",[478,567,568],{"class":488},"=",[478,570,571],{"class":505},"phc_your-project-api-key\n",[514,573,575],{"id":574},"_3-wire-the-drain-to-your-framework","3. Wire the drain to your framework",[577,578,579,693,824,886,940,999,1053,1106],"code-group",{},[467,580,583],{"className":469,"code":581,"filename":582,"language":472,"meta":473,"style":473},"\u002F\u002F server\u002Fplugins\u002Fevlog-drain.ts\nimport { createPostHogDrain } from 'evlog\u002Fposthog'\n\nexport default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook('evlog:drain', createPostHogDrain())\n})\n","Nuxt \u002F Nitro",[475,584,585,591,610,617,648,684],{"__ignoreMap":473},[478,586,587],{"class":480,"line":481},[478,588,590],{"class":589},"sHwdD","\u002F\u002F server\u002Fplugins\u002Fevlog-drain.ts\n",[478,592,594,596,598,600,602,604,606,608],{"class":480,"line":593},2,[478,595,485],{"class":484},[478,597,489],{"class":488},[478,599,493],{"class":492},[478,601,496],{"class":488},[478,603,499],{"class":484},[478,605,502],{"class":488},[478,607,506],{"class":505},[478,609,509],{"class":488},[478,611,613],{"class":480,"line":612},3,[478,614,616],{"emptyLinePlaceholder":615},true,"\n",[478,618,620,623,626,630,633,635,639,641,645],{"class":480,"line":619},4,[478,621,622],{"class":484},"export",[478,624,625],{"class":484}," default",[478,627,629],{"class":628},"s2Zo4"," defineNitroPlugin",[478,631,632],{"class":492},"(",[478,634,632],{"class":488},[478,636,638],{"class":637},"sHdIc","nitroApp",[478,640,548],{"class":488},[478,642,644],{"class":643},"spNyl"," =>",[478,646,647],{"class":488}," {\n",[478,649,651,654,657,660,662,665,668,671,674,676,679,681],{"class":480,"line":650},5,[478,652,653],{"class":492},"  nitroApp",[478,655,656],{"class":488},".",[478,658,659],{"class":492},"hooks",[478,661,656],{"class":488},[478,663,664],{"class":628},"hook",[478,666,632],{"class":667},"swJcz",[478,669,670],{"class":488},"'",[478,672,673],{"class":505},"evlog:drain",[478,675,670],{"class":488},[478,677,678],{"class":488},",",[478,680,493],{"class":628},[478,682,683],{"class":667},"())\n",[478,685,687,690],{"class":480,"line":686},6,[478,688,689],{"class":488},"}",[478,691,692],{"class":492},")\n",[467,694,696],{"className":469,"code":695,"filename":216,"language":472,"meta":473,"style":473},"\u002F\u002F lib\u002Fevlog.ts\nimport { createEvlog } from 'evlog\u002Fnext'\nimport { createPostHogDrain } from 'evlog\u002Fposthog'\n\nexport const { withEvlog, useLogger, log, createError } = createEvlog({\n  service: 'my-app',\n  drain: createPostHogDrain(),\n})\n",[475,697,698,703,723,741,745,784,802,817],{"__ignoreMap":473},[478,699,700],{"class":480,"line":481},[478,701,702],{"class":589},"\u002F\u002F lib\u002Fevlog.ts\n",[478,704,705,707,709,712,714,716,718,721],{"class":480,"line":593},[478,706,485],{"class":484},[478,708,489],{"class":488},[478,710,711],{"class":492}," createEvlog",[478,713,496],{"class":488},[478,715,499],{"class":484},[478,717,502],{"class":488},[478,719,720],{"class":505},"evlog\u002Fnext",[478,722,509],{"class":488},[478,724,725,727,729,731,733,735,737,739],{"class":480,"line":612},[478,726,485],{"class":484},[478,728,489],{"class":488},[478,730,493],{"class":492},[478,732,496],{"class":488},[478,734,499],{"class":484},[478,736,502],{"class":488},[478,738,506],{"class":505},[478,740,509],{"class":488},[478,742,743],{"class":480,"line":619},[478,744,616],{"emptyLinePlaceholder":615},[478,746,747,749,752,754,757,759,762,764,767,769,772,774,777,779,781],{"class":480,"line":650},[478,748,622],{"class":484},[478,750,751],{"class":643}," const",[478,753,489],{"class":488},[478,755,756],{"class":492}," withEvlog",[478,758,678],{"class":488},[478,760,761],{"class":492}," useLogger",[478,763,678],{"class":488},[478,765,766],{"class":492}," log",[478,768,678],{"class":488},[478,770,771],{"class":492}," createError ",[478,773,689],{"class":488},[478,775,776],{"class":488}," =",[478,778,711],{"class":628},[478,780,632],{"class":492},[478,782,783],{"class":488},"{\n",[478,785,786,789,792,794,797,799],{"class":480,"line":686},[478,787,788],{"class":667},"  service",[478,790,791],{"class":488},":",[478,793,502],{"class":488},[478,795,796],{"class":505},"my-app",[478,798,670],{"class":488},[478,800,801],{"class":488},",\n",[478,803,805,808,810,812,815],{"class":480,"line":804},7,[478,806,807],{"class":667},"  drain",[478,809,791],{"class":488},[478,811,493],{"class":628},[478,813,814],{"class":492},"()",[478,816,801],{"class":488},[478,818,820,822],{"class":480,"line":819},8,[478,821,689],{"class":488},[478,823,692],{"class":492},[467,825,827],{"className":469,"code":826,"filename":246,"language":472,"meta":473,"style":473},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\napp.use(evlog({ drain: createPostHogDrain() }))\n",[475,828,829,847,851],{"__ignoreMap":473},[478,830,831,833,835,837,839,841,843,845],{"class":480,"line":481},[478,832,485],{"class":484},[478,834,489],{"class":488},[478,836,493],{"class":492},[478,838,496],{"class":488},[478,840,499],{"class":484},[478,842,502],{"class":488},[478,844,506],{"class":505},[478,846,509],{"class":488},[478,848,849],{"class":480,"line":593},[478,850,616],{"emptyLinePlaceholder":615},[478,852,853,856,858,861,863,866,868,871,874,876,878,881,883],{"class":480,"line":612},[478,854,855],{"class":492},"app",[478,857,656],{"class":488},[478,859,860],{"class":628},"use",[478,862,632],{"class":492},[478,864,865],{"class":628},"evlog",[478,867,632],{"class":492},[478,869,870],{"class":488},"{",[478,872,873],{"class":667}," drain",[478,875,791],{"class":488},[478,877,493],{"class":628},[478,879,880],{"class":492},"() ",[478,882,689],{"class":488},[478,884,885],{"class":492},"))\n",[467,887,888],{"className":469,"code":826,"filename":241,"language":472,"meta":473,"style":473},[475,889,890,908,912],{"__ignoreMap":473},[478,891,892,894,896,898,900,902,904,906],{"class":480,"line":481},[478,893,485],{"class":484},[478,895,489],{"class":488},[478,897,493],{"class":492},[478,899,496],{"class":488},[478,901,499],{"class":484},[478,903,502],{"class":488},[478,905,506],{"class":505},[478,907,509],{"class":488},[478,909,910],{"class":480,"line":593},[478,911,616],{"emptyLinePlaceholder":615},[478,913,914,916,918,920,922,924,926,928,930,932,934,936,938],{"class":480,"line":612},[478,915,855],{"class":492},[478,917,656],{"class":488},[478,919,860],{"class":628},[478,921,632],{"class":492},[478,923,865],{"class":628},[478,925,632],{"class":492},[478,927,870],{"class":488},[478,929,873],{"class":667},[478,931,791],{"class":488},[478,933,493],{"class":628},[478,935,880],{"class":492},[478,937,689],{"class":488},[478,939,885],{"class":492},[467,941,943],{"className":469,"code":942,"filename":251,"language":472,"meta":473,"style":473},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\nawait app.register(evlog, { drain: createPostHogDrain() })\n",[475,944,945,963,967],{"__ignoreMap":473},[478,946,947,949,951,953,955,957,959,961],{"class":480,"line":481},[478,948,485],{"class":484},[478,950,489],{"class":488},[478,952,493],{"class":492},[478,954,496],{"class":488},[478,956,499],{"class":484},[478,958,502],{"class":488},[478,960,506],{"class":505},[478,962,509],{"class":488},[478,964,965],{"class":480,"line":593},[478,966,616],{"emptyLinePlaceholder":615},[478,968,969,972,975,977,980,983,985,987,989,991,993,995,997],{"class":480,"line":612},[478,970,971],{"class":484},"await",[478,973,974],{"class":492}," app",[478,976,656],{"class":488},[478,978,979],{"class":628},"register",[478,981,982],{"class":492},"(evlog",[478,984,678],{"class":488},[478,986,489],{"class":488},[478,988,873],{"class":667},[478,990,791],{"class":488},[478,992,493],{"class":628},[478,994,880],{"class":492},[478,996,689],{"class":488},[478,998,692],{"class":492},[467,1000,1001],{"className":469,"code":826,"filename":256,"language":472,"meta":473,"style":473},[475,1002,1003,1021,1025],{"__ignoreMap":473},[478,1004,1005,1007,1009,1011,1013,1015,1017,1019],{"class":480,"line":481},[478,1006,485],{"class":484},[478,1008,489],{"class":488},[478,1010,493],{"class":492},[478,1012,496],{"class":488},[478,1014,499],{"class":484},[478,1016,502],{"class":488},[478,1018,506],{"class":505},[478,1020,509],{"class":488},[478,1022,1023],{"class":480,"line":593},[478,1024,616],{"emptyLinePlaceholder":615},[478,1026,1027,1029,1031,1033,1035,1037,1039,1041,1043,1045,1047,1049,1051],{"class":480,"line":612},[478,1028,855],{"class":492},[478,1030,656],{"class":488},[478,1032,860],{"class":628},[478,1034,632],{"class":492},[478,1036,865],{"class":628},[478,1038,632],{"class":492},[478,1040,870],{"class":488},[478,1042,873],{"class":667},[478,1044,791],{"class":488},[478,1046,493],{"class":628},[478,1048,880],{"class":492},[478,1050,689],{"class":488},[478,1052,885],{"class":492},[467,1054,1056],{"className":469,"code":1055,"filename":236,"language":472,"meta":473,"style":473},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\nEvlogModule.forRoot({ drain: createPostHogDrain() })\n",[475,1057,1058,1076,1080],{"__ignoreMap":473},[478,1059,1060,1062,1064,1066,1068,1070,1072,1074],{"class":480,"line":481},[478,1061,485],{"class":484},[478,1063,489],{"class":488},[478,1065,493],{"class":492},[478,1067,496],{"class":488},[478,1069,499],{"class":484},[478,1071,502],{"class":488},[478,1073,506],{"class":505},[478,1075,509],{"class":488},[478,1077,1078],{"class":480,"line":593},[478,1079,616],{"emptyLinePlaceholder":615},[478,1081,1082,1085,1087,1090,1092,1094,1096,1098,1100,1102,1104],{"class":480,"line":612},[478,1083,1084],{"class":492},"EvlogModule",[478,1086,656],{"class":488},[478,1088,1089],{"class":628},"forRoot",[478,1091,632],{"class":492},[478,1093,870],{"class":488},[478,1095,873],{"class":667},[478,1097,791],{"class":488},[478,1099,493],{"class":628},[478,1101,880],{"class":492},[478,1103,689],{"class":488},[478,1105,692],{"class":492},[467,1107,1109],{"className":469,"code":1108,"filename":271,"language":472,"meta":473,"style":473},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\ninitLogger({ drain: createPostHogDrain() })\n",[475,1110,1111,1129,1133],{"__ignoreMap":473},[478,1112,1113,1115,1117,1119,1121,1123,1125,1127],{"class":480,"line":481},[478,1114,485],{"class":484},[478,1116,489],{"class":488},[478,1118,493],{"class":492},[478,1120,496],{"class":488},[478,1122,499],{"class":484},[478,1124,502],{"class":488},[478,1126,506],{"class":505},[478,1128,509],{"class":488},[478,1130,1131],{"class":480,"line":593},[478,1132,616],{"emptyLinePlaceholder":615},[478,1134,1135,1138,1140,1142,1144,1146,1148,1150,1152],{"class":480,"line":612},[478,1136,1137],{"class":628},"initLogger",[478,1139,632],{"class":492},[478,1141,870],{"class":488},[478,1143,873],{"class":667},[478,1145,791],{"class":488},[478,1147,493],{"class":628},[478,1149,880],{"class":492},[478,1151,689],{"class":488},[478,1153,692],{"class":492},[399,1155,1156],{},"That's it! Your wide events will now appear in PostHog Logs with full OTLP structure including severity levels, trace context, and structured attributes.",[460,1158,170],{"id":1159},"configuration",[399,1161,1162],{},"The adapter reads configuration from multiple sources (highest priority first):",[423,1164,1165,1174,1184],{},[426,1166,1167,1170,1171],{},[532,1168,1169],{},"Overrides"," passed to ",[475,1172,1173],{},"createPostHogDrain()",[426,1175,1176,1179,1180,1183],{},[532,1177,1178],{},"Runtime config"," at ",[475,1181,1182],{},"runtimeConfig.posthog"," (Nuxt\u002FNitro only)",[426,1185,1186,1189,1190,1193,1194,548],{},[532,1187,1188],{},"Environment variables"," (",[475,1191,1192],{},"POSTHOG_*"," or ",[475,1195,1196],{},"NUXT_POSTHOG_*",[514,1198,1200],{"id":1199},"environment-variables","Environment Variables",[1202,1203,1204,1220],"table",{},[1205,1206,1207],"thead",{},[1208,1209,1210,1214,1217],"tr",{},[1211,1212,1213],"th",{},"Variable",[1211,1215,1216],{},"Nuxt alias",[1211,1218,1219],{},"Description",[1221,1222,1223,1240],"tbody",{},[1208,1224,1225,1230,1235],{},[1226,1227,1228],"td",{},[475,1229,565],{},[1226,1231,1232],{},[475,1233,1234],{},"NUXT_POSTHOG_API_KEY",[1226,1236,1237,1238,548],{},"Project API key (starts with ",[475,1239,547],{},[1208,1241,1242,1247,1252],{},[1226,1243,1244],{},[475,1245,1246],{},"POSTHOG_HOST",[1226,1248,1249],{},[475,1250,1251],{},"NUXT_POSTHOG_HOST",[1226,1253,1254],{},"PostHog host URL (for EU or self-hosted)",[514,1256,1258],{"id":1257},"runtime-config-nuxt-only","Runtime Config (Nuxt only)",[399,1260,1261,1262,1265],{},"Configure via ",[475,1263,1264],{},"nuxt.config.ts"," for type-safe configuration:",[467,1267,1269],{"className":469,"code":1268,"filename":1264,"language":472,"meta":473,"style":473},"export default defineNuxtConfig({\n  runtimeConfig: {\n    posthog: {\n      apiKey: '', \u002F\u002F Set via NUXT_POSTHOG_API_KEY\n      host: '', \u002F\u002F Set via NUXT_POSTHOG_HOST\n    },\n  },\n})\n",[475,1270,1271,1284,1293,1302,1317,1331,1336,1341],{"__ignoreMap":473},[478,1272,1273,1275,1277,1280,1282],{"class":480,"line":481},[478,1274,622],{"class":484},[478,1276,625],{"class":484},[478,1278,1279],{"class":628}," defineNuxtConfig",[478,1281,632],{"class":492},[478,1283,783],{"class":488},[478,1285,1286,1289,1291],{"class":480,"line":593},[478,1287,1288],{"class":667},"  runtimeConfig",[478,1290,791],{"class":488},[478,1292,647],{"class":488},[478,1294,1295,1298,1300],{"class":480,"line":612},[478,1296,1297],{"class":667},"    posthog",[478,1299,791],{"class":488},[478,1301,647],{"class":488},[478,1303,1304,1307,1309,1312,1314],{"class":480,"line":619},[478,1305,1306],{"class":667},"      apiKey",[478,1308,791],{"class":488},[478,1310,1311],{"class":488}," ''",[478,1313,678],{"class":488},[478,1315,1316],{"class":589}," \u002F\u002F Set via NUXT_POSTHOG_API_KEY\n",[478,1318,1319,1322,1324,1326,1328],{"class":480,"line":650},[478,1320,1321],{"class":667},"      host",[478,1323,791],{"class":488},[478,1325,1311],{"class":488},[478,1327,678],{"class":488},[478,1329,1330],{"class":589}," \u002F\u002F Set via NUXT_POSTHOG_HOST\n",[478,1332,1333],{"class":480,"line":686},[478,1334,1335],{"class":488},"    },\n",[478,1337,1338],{"class":480,"line":804},[478,1339,1340],{"class":488},"  },\n",[478,1342,1343,1345],{"class":480,"line":819},[478,1344,689],{"class":488},[478,1346,692],{"class":492},[514,1348,1350],{"id":1349},"override-options","Override Options",[399,1352,1353],{},"Pass options directly to override any configuration:",[467,1355,1358],{"className":469,"code":1356,"filename":1357,"language":472,"meta":473,"style":473},"const drain = createPostHogDrain({\n  host: 'https:\u002F\u002Feu.i.posthog.com',\n  timeout: 10000,\n})\n","server\u002Fplugins\u002Fevlog-drain.ts",[475,1359,1360,1376,1392,1405],{"__ignoreMap":473},[478,1361,1362,1365,1368,1370,1372,1374],{"class":480,"line":481},[478,1363,1364],{"class":643},"const",[478,1366,1367],{"class":492}," drain ",[478,1369,568],{"class":488},[478,1371,493],{"class":628},[478,1373,632],{"class":492},[478,1375,783],{"class":488},[478,1377,1378,1381,1383,1385,1388,1390],{"class":480,"line":593},[478,1379,1380],{"class":667},"  host",[478,1382,791],{"class":488},[478,1384,502],{"class":488},[478,1386,1387],{"class":505},"https:\u002F\u002Feu.i.posthog.com",[478,1389,670],{"class":488},[478,1391,801],{"class":488},[478,1393,1394,1397,1399,1403],{"class":480,"line":612},[478,1395,1396],{"class":667},"  timeout",[478,1398,791],{"class":488},[478,1400,1402],{"class":1401},"sbssI"," 10000",[478,1404,801],{"class":488},[478,1406,1407,1409],{"class":480,"line":619},[478,1408,689],{"class":488},[478,1410,692],{"class":492},[514,1412,1414],{"id":1413},"full-configuration-reference","Full Configuration Reference",[1202,1416,1417,1432],{},[1205,1418,1419],{},[1208,1420,1421,1424,1427,1430],{},[1211,1422,1423],{},"Option",[1211,1425,1426],{},"Type",[1211,1428,1429],{},"Default",[1211,1431,1219],{},[1221,1433,1434,1452,1471],{},[1208,1435,1436,1441,1446,1449],{},[1226,1437,1438],{},[475,1439,1440],{},"apiKey",[1226,1442,1443],{},[475,1444,1445],{},"string",[1226,1447,1448],{},"-",[1226,1450,1451],{},"Project API key (required)",[1208,1453,1454,1459,1463,1468],{},[1226,1455,1456],{},[475,1457,1458],{},"host",[1226,1460,1461],{},[475,1462,1445],{},[1226,1464,1465],{},[475,1466,1467],{},"https:\u002F\u002Fus.i.posthog.com",[1226,1469,1470],{},"PostHog host URL",[1208,1472,1473,1478,1483,1488],{},[1226,1474,1475],{},[475,1476,1477],{},"timeout",[1226,1479,1480],{},[475,1481,1482],{},"number",[1226,1484,1485],{},[475,1486,1487],{},"5000",[1226,1489,1490],{},"Request timeout in milliseconds",[460,1492,1494],{"id":1493},"how-it-works","How It Works",[399,1496,1497,1498,1500,1501,1504],{},"Under the hood, ",[475,1499,1173],{}," wraps the OTLP adapter's ",[475,1502,1503],{},"sendBatchToOTLP()"," with PostHog-specific defaults:",[1506,1507,1508,1518,1527],"ul",{},[426,1509,1510,1513,1514,1517],{},[532,1511,1512],{},"Endpoint",": ",[475,1515,1516],{},"{host}\u002Fi\u002Fv1\u002Flogs"," (PostHog's OTLP log ingest endpoint)",[426,1519,1520,1513,1523,1526],{},[532,1521,1522],{},"Auth",[475,1524,1525],{},"Authorization: Bearer {apiKey}"," header",[426,1528,1529,1532,1533,1536],{},[532,1530,1531],{},"Format",": Standard OTLP ",[475,1534,1535],{},"ExportLogsServiceRequest"," with severity levels, trace context, and structured attributes",[460,1538,1540],{"id":1539},"regions","Regions",[399,1542,1543,1544,1546],{},"PostHog offers US and EU cloud hosting. Set the ",[475,1545,1458],{}," to match your region:",[1202,1548,1549,1559],{},[1205,1550,1551],{},[1208,1552,1553,1556],{},[1211,1554,1555],{},"Region",[1211,1557,1558],{},"Host",[1221,1560,1561,1570,1579],{},[1208,1562,1563,1566],{},[1226,1564,1565],{},"US (default)",[1226,1567,1568],{},[475,1569,1467],{},[1208,1571,1572,1575],{},[1226,1573,1574],{},"EU",[1226,1576,1577],{},[475,1578,1387],{},[1208,1580,1581,1583],{},[1226,1582,338],{},[1226,1584,1585],{},"Your instance URL",[467,1587,1589],{"className":555,"code":1588,"filename":557,"language":558,"meta":473,"style":473},"# EU region\nPOSTHOG_API_KEY=phc_xxx\nPOSTHOG_HOST=https:\u002F\u002Feu.i.posthog.com\n",[475,1590,1591,1596,1605],{"__ignoreMap":473},[478,1592,1593],{"class":480,"line":481},[478,1594,1595],{"class":589},"# EU region\n",[478,1597,1598,1600,1602],{"class":480,"line":593},[478,1599,565],{"class":492},[478,1601,568],{"class":488},[478,1603,1604],{"class":505},"phc_xxx\n",[478,1606,1607,1609,1611],{"class":480,"line":612},[478,1608,1246],{"class":492},[478,1610,568],{"class":488},[478,1612,1613],{"class":505},"https:\u002F\u002Feu.i.posthog.com\n",[460,1615,1617],{"id":1616},"querying-logs-in-posthog","Querying Logs in PostHog",[399,1619,1620,1621,1624],{},"Once your logs are flowing, use the ",[532,1622,1623],{},"Logs"," tab in PostHog to query them:",[423,1626,1627,1632,1635],{},[426,1628,530,1629,1631],{},[532,1630,1623],{}," and filter by service, severity, or any structured attribute",[426,1633,1634],{},"Use the search bar to find specific log entries",[426,1636,1637],{},"Click on a log entry to see all structured attributes",[460,1639,1641],{"id":1640},"posthog-events-custom-events","PostHog Events (Custom Events)",[399,1643,1644,1645,791],{},"If you prefer sending logs as PostHog custom events (e.g., for product analytics, cohorts, or funnels), use ",[475,1646,1647],{},"createPostHogEventsDrain()",[467,1649,1651],{"className":469,"code":1650,"filename":1357,"language":472,"meta":473,"style":473},"import { createPostHogEventsDrain } from 'evlog\u002Fposthog'\n\nconst drain = createPostHogEventsDrain({\n  eventName: 'server_request',\n  distinctId: 'my-backend-service',\n})\n",[475,1652,1653,1672,1676,1690,1706,1722],{"__ignoreMap":473},[478,1654,1655,1657,1659,1662,1664,1666,1668,1670],{"class":480,"line":481},[478,1656,485],{"class":484},[478,1658,489],{"class":488},[478,1660,1661],{"class":492}," createPostHogEventsDrain",[478,1663,496],{"class":488},[478,1665,499],{"class":484},[478,1667,502],{"class":488},[478,1669,506],{"class":505},[478,1671,509],{"class":488},[478,1673,1674],{"class":480,"line":593},[478,1675,616],{"emptyLinePlaceholder":615},[478,1677,1678,1680,1682,1684,1686,1688],{"class":480,"line":612},[478,1679,1364],{"class":643},[478,1681,1367],{"class":492},[478,1683,568],{"class":488},[478,1685,1661],{"class":628},[478,1687,632],{"class":492},[478,1689,783],{"class":488},[478,1691,1692,1695,1697,1699,1702,1704],{"class":480,"line":619},[478,1693,1694],{"class":667},"  eventName",[478,1696,791],{"class":488},[478,1698,502],{"class":488},[478,1700,1701],{"class":505},"server_request",[478,1703,670],{"class":488},[478,1705,801],{"class":488},[478,1707,1708,1711,1713,1715,1718,1720],{"class":480,"line":650},[478,1709,1710],{"class":667},"  distinctId",[478,1712,791],{"class":488},[478,1714,502],{"class":488},[478,1716,1717],{"class":505},"my-backend-service",[478,1719,670],{"class":488},[478,1721,801],{"class":488},[478,1723,1724,1726],{"class":480,"line":686},[478,1725,689],{"class":488},[478,1727,692],{"class":492},[399,1729,1730,1731,1734,1735,1737,1738,1741],{},"Then pass ",[475,1732,1733],{},"drain"," to your framework the same way as ",[475,1736,1173],{}," (see ",[402,1739,20],{"href":1740},"#quick-start"," above).",[1743,1744,1746,1747,1749],"callout",{"color":1745,"icon":13},"info","Custom events count towards your PostHog event quota. PostHog Logs (the default ",[475,1748,1173],{},") is significantly cheaper.",[514,1751,1753],{"id":1752},"events-configuration","Events Configuration",[1202,1755,1756,1768],{},[1205,1757,1758],{},[1208,1759,1760,1762,1764,1766],{},[1211,1761,1423],{},[1211,1763,1426],{},[1211,1765,1429],{},[1211,1767,1219],{},[1221,1769,1770,1784,1800,1819,1842],{},[1208,1771,1772,1776,1780,1782],{},[1226,1773,1774],{},[475,1775,1440],{},[1226,1777,1778],{},[475,1779,1445],{},[1226,1781,1448],{},[1226,1783,1451],{},[1208,1785,1786,1790,1794,1798],{},[1226,1787,1788],{},[475,1789,1458],{},[1226,1791,1792],{},[475,1793,1445],{},[1226,1795,1796],{},[475,1797,1467],{},[1226,1799,1470],{},[1208,1801,1802,1807,1811,1816],{},[1226,1803,1804],{},[475,1805,1806],{},"eventName",[1226,1808,1809],{},[475,1810,1445],{},[1226,1812,1813],{},[475,1814,1815],{},"evlog_wide_event",[1226,1817,1818],{},"PostHog event name",[1208,1820,1821,1826,1830,1835],{},[1226,1822,1823],{},[475,1824,1825],{},"distinctId",[1226,1827,1828],{},[475,1829,1445],{},[1226,1831,1832],{},[475,1833,1834],{},"event.service",[1226,1836,1837,1838,1841],{},"Override ",[475,1839,1840],{},"distinct_id"," for all events",[1208,1843,1844,1848,1852,1856],{},[1226,1845,1846],{},[475,1847,1477],{},[1226,1849,1850],{},[475,1851,1482],{},[1226,1853,1854],{},[475,1855,1487],{},[1226,1857,1490],{},[514,1859,1861],{"id":1860},"event-format","Event Format",[399,1863,1864],{},"evlog maps wide events to PostHog events:",[1202,1866,1867,1877],{},[1205,1868,1869],{},[1208,1870,1871,1874],{},[1211,1872,1873],{},"evlog Field",[1211,1875,1876],{},"PostHog Field",[1221,1878,1879,1897,1908,1920,1931,1943],{},[1208,1880,1881,1892],{},[1226,1882,1883,1193,1886,1193,1889],{},[475,1884,1885],{},"config.distinctId",[475,1887,1888],{},"userId",[475,1890,1891],{},"service",[1226,1893,1894,1896],{},[475,1895,1840],{}," (fallback chain)",[1208,1898,1899,1904],{},[1226,1900,1901],{},[475,1902,1903],{},"timestamp",[1226,1905,1906],{},[475,1907,1903],{},[1208,1909,1910,1915],{},[1226,1911,1912],{},[475,1913,1914],{},"level",[1226,1916,1917],{},[475,1918,1919],{},"properties.level",[1208,1921,1922,1926],{},[1226,1923,1924],{},[475,1925,1891],{},[1226,1927,1928],{},[475,1929,1930],{},"properties.service",[1208,1932,1933,1938],{},[1226,1934,1935],{},[475,1936,1937],{},"environment",[1226,1939,1940],{},[475,1941,1942],{},"properties.environment",[1208,1944,1945,1948],{},[1226,1946,1947],{},"All other fields",[1226,1949,1950],{},[475,1951,1952],{},"properties.*",[514,1954,1956],{"id":1955},"distinct-id-resolution","Distinct ID Resolution",[399,1958,1959,1960,1962],{},"The ",[475,1961,1840],{}," follows a fallback chain:",[423,1964,1965,1974,1982],{},[426,1966,1967,1971,1972],{},[532,1968,1969],{},[475,1970,1885],{}," - explicit override in ",[475,1973,1647],{},[426,1975,1976,1981],{},[532,1977,1978],{},[475,1979,1980],{},"event.userId"," - automatically picked up if present as a string",[426,1983,1984,1988],{},[532,1985,1986],{},[475,1987,1834],{}," - final fallback",[514,1990,1992],{"id":1991},"logs-vs-events","Logs vs Events",[1202,1994,1995,2009],{},[1205,1996,1997],{},[1208,1998,1999,2001,2005],{},[1211,2000],{},[1211,2002,2003],{},[475,2004,1173],{},[1211,2006,2007],{},[475,2008,1647],{},[1221,2010,2011,2029,2042,2055],{},[1208,2012,2013,2017,2023],{},[1226,2014,2015],{},[532,2016,1531],{},[1226,2018,2019,2020,548],{},"OTLP Logs (",[475,2021,2022],{},"\u002Fi\u002Fv1\u002Flogs",[1226,2024,2025,2026,548],{},"PostHog Events (",[475,2027,2028],{},"\u002Fbatch\u002F",[1208,2030,2031,2036,2039],{},[1226,2032,2033],{},[532,2034,2035],{},"PostHog UI",[1226,2037,2038],{},"Logs viewer",[1226,2040,2041],{},"Events explorer",[1208,2043,2044,2049,2052],{},[1226,2045,2046],{},[532,2047,2048],{},"Cost",[1226,2050,2051],{},"Lower (dedicated logs pipeline)",[1226,2053,2054],{},"Higher (counts as events)",[1208,2056,2057,2062,2065],{},[1226,2058,2059],{},[532,2060,2061],{},"Best for",[1226,2063,2064],{},"Debugging, log search, observability",[1226,2066,2067],{},"Product analytics, cohorts, funnels",[399,2069,2070],{},"You can use both drains simultaneously to get the best of both worlds:",[467,2072,2074],{"className":469,"code":2073,"filename":1357,"language":472,"meta":473,"style":473},"import { createPostHogDrain, createPostHogEventsDrain } from 'evlog\u002Fposthog'\n\nconst logs = createPostHogDrain()\nconst events = createPostHogEventsDrain()\n\nconst drain = async (ctx) => {\n  await Promise.allSettled([logs(ctx), events(ctx)])\n}\n",[475,2075,2076,2098,2102,2116,2129,2133,2155,2193],{"__ignoreMap":473},[478,2077,2078,2080,2082,2084,2086,2088,2090,2092,2094,2096],{"class":480,"line":481},[478,2079,485],{"class":484},[478,2081,489],{"class":488},[478,2083,493],{"class":492},[478,2085,678],{"class":488},[478,2087,1661],{"class":492},[478,2089,496],{"class":488},[478,2091,499],{"class":484},[478,2093,502],{"class":488},[478,2095,506],{"class":505},[478,2097,509],{"class":488},[478,2099,2100],{"class":480,"line":593},[478,2101,616],{"emptyLinePlaceholder":615},[478,2103,2104,2106,2109,2111,2113],{"class":480,"line":612},[478,2105,1364],{"class":643},[478,2107,2108],{"class":492}," logs ",[478,2110,568],{"class":488},[478,2112,493],{"class":628},[478,2114,2115],{"class":492},"()\n",[478,2117,2118,2120,2123,2125,2127],{"class":480,"line":619},[478,2119,1364],{"class":643},[478,2121,2122],{"class":492}," events ",[478,2124,568],{"class":488},[478,2126,1661],{"class":628},[478,2128,2115],{"class":492},[478,2130,2131],{"class":480,"line":650},[478,2132,616],{"emptyLinePlaceholder":615},[478,2134,2135,2137,2139,2141,2144,2146,2149,2151,2153],{"class":480,"line":686},[478,2136,1364],{"class":643},[478,2138,1367],{"class":492},[478,2140,568],{"class":488},[478,2142,2143],{"class":643}," async",[478,2145,1189],{"class":488},[478,2147,2148],{"class":637},"ctx",[478,2150,548],{"class":488},[478,2152,644],{"class":643},[478,2154,647],{"class":488},[478,2156,2157,2160,2164,2166,2169,2172,2175,2177,2179,2181,2183,2186,2188,2190],{"class":480,"line":804},[478,2158,2159],{"class":484},"  await",[478,2161,2163],{"class":2162},"sBMFI"," Promise",[478,2165,656],{"class":488},[478,2167,2168],{"class":628},"allSettled",[478,2170,2171],{"class":667},"([",[478,2173,2174],{"class":628},"logs",[478,2176,632],{"class":667},[478,2178,2148],{"class":492},[478,2180,548],{"class":667},[478,2182,678],{"class":488},[478,2184,2185],{"class":628}," events",[478,2187,632],{"class":667},[478,2189,2148],{"class":492},[478,2191,2192],{"class":667},")])\n",[478,2194,2195],{"class":480,"line":819},[478,2196,2197],{"class":488},"}\n",[460,2199,2201],{"id":2200},"troubleshooting","Troubleshooting",[514,2203,2205],{"id":2204},"missing-apikey-error","Missing apiKey error",[467,2207,2213],{"className":2208,"code":2210,"filename":2211,"language":2212,"meta":473},[2209],"language-text","[evlog\u002Fposthog] Missing apiKey. Set POSTHOG_API_KEY env var or pass to createPostHogDrain()\n","Console","text",[475,2214,2210],{"__ignoreMap":473},[399,2216,2217],{},"Make sure your environment variable is set and the server was restarted after adding it.",[514,2219,2221],{"id":2220},"events-not-appearing","Events not appearing",[399,2223,2224],{},"PostHog processes events asynchronously. There may be a short delay (typically under 1 minute) before events appear in the dashboard.",[423,2226,2227,2234,2239],{},[426,2228,2229,2230,2233],{},"Check the server console for ",[475,2231,2232],{},"[evlog\u002Fposthog]"," error messages",[426,2235,2236,2237],{},"Verify your API key is correct and starts with ",[475,2238,547],{},[426,2240,2241,2242,2244],{},"Confirm your ",[475,2243,1458],{}," matches your PostHog region (US vs EU)",[514,2246,2248],{"id":2247},"wrong-region","Wrong region",[399,2250,2251,2252,2254],{},"If you're on PostHog EU but using the default US host, event delivery will fail and the adapter will log errors (for example under ",[475,2253,2232],{},") to your server console. Set the correct host:",[467,2256,2258],{"className":555,"code":2257,"filename":557,"language":558,"meta":473,"style":473},"POSTHOG_HOST=https:\u002F\u002Feu.i.posthog.com\n",[475,2259,2260],{"__ignoreMap":473},[478,2261,2262,2264,2266],{"class":480,"line":481},[478,2263,1246],{"class":492},[478,2265,568],{"class":488},[478,2267,1613],{"class":505},[460,2269,2271],{"id":2270},"direct-api-usage","Direct API Usage",[399,2273,2274],{},"For advanced use cases, you can use the lower-level functions:",[467,2276,2279],{"className":469,"code":2277,"filename":2278,"language":472,"meta":473,"style":473},"import { sendToPostHog, sendBatchToPostHog } from 'evlog\u002Fposthog'\n\n\u002F\u002F Send a single event to PostHog Logs (OTLP)\nawait sendToPostHog(event, {\n  apiKey: 'phc_xxx',\n})\n\n\u002F\u002F Send multiple events in one request\nawait sendBatchToPostHog(events, {\n  apiKey: 'phc_xxx',\n})\n","server\u002Futils\u002Fposthog.ts",[475,2280,2281,2305,2309,2314,2327,2343,2349,2353,2358,2372,2387],{"__ignoreMap":473},[478,2282,2283,2285,2287,2290,2292,2295,2297,2299,2301,2303],{"class":480,"line":481},[478,2284,485],{"class":484},[478,2286,489],{"class":488},[478,2288,2289],{"class":492}," sendToPostHog",[478,2291,678],{"class":488},[478,2293,2294],{"class":492}," sendBatchToPostHog",[478,2296,496],{"class":488},[478,2298,499],{"class":484},[478,2300,502],{"class":488},[478,2302,506],{"class":505},[478,2304,509],{"class":488},[478,2306,2307],{"class":480,"line":593},[478,2308,616],{"emptyLinePlaceholder":615},[478,2310,2311],{"class":480,"line":612},[478,2312,2313],{"class":589},"\u002F\u002F Send a single event to PostHog Logs (OTLP)\n",[478,2315,2316,2318,2320,2323,2325],{"class":480,"line":619},[478,2317,971],{"class":484},[478,2319,2289],{"class":628},[478,2321,2322],{"class":492},"(event",[478,2324,678],{"class":488},[478,2326,647],{"class":488},[478,2328,2329,2332,2334,2336,2339,2341],{"class":480,"line":650},[478,2330,2331],{"class":667},"  apiKey",[478,2333,791],{"class":488},[478,2335,502],{"class":488},[478,2337,2338],{"class":505},"phc_xxx",[478,2340,670],{"class":488},[478,2342,801],{"class":488},[478,2344,2345,2347],{"class":480,"line":686},[478,2346,689],{"class":488},[478,2348,692],{"class":492},[478,2350,2351],{"class":480,"line":804},[478,2352,616],{"emptyLinePlaceholder":615},[478,2354,2355],{"class":480,"line":819},[478,2356,2357],{"class":589},"\u002F\u002F Send multiple events in one request\n",[478,2359,2361,2363,2365,2368,2370],{"class":480,"line":2360},9,[478,2362,971],{"class":484},[478,2364,2294],{"class":628},[478,2366,2367],{"class":492},"(events",[478,2369,678],{"class":488},[478,2371,647],{"class":488},[478,2373,2375,2377,2379,2381,2383,2385],{"class":480,"line":2374},10,[478,2376,2331],{"class":667},[478,2378,791],{"class":488},[478,2380,502],{"class":488},[478,2382,2338],{"class":505},[478,2384,670],{"class":488},[478,2386,801],{"class":488},[478,2388,2390,2392],{"class":480,"line":2389},11,[478,2391,689],{"class":488},[478,2393,692],{"class":492},[399,2395,2396],{},"For custom events, use the events-specific functions:",[467,2398,2400],{"className":469,"code":2399,"filename":2278,"language":472,"meta":473,"style":473},"import { sendToPostHogEvents, sendBatchToPostHogEvents, toPostHogEvent } from 'evlog\u002Fposthog'\n\n\u002F\u002F Send a single custom event\nawait sendToPostHogEvents(event, {\n  apiKey: 'phc_xxx',\n})\n\n\u002F\u002F Send multiple custom events in one request\nawait sendBatchToPostHogEvents(events, {\n  apiKey: 'phc_xxx',\n})\n\n\u002F\u002F Convert event to PostHog format (for inspection)\nconst posthogEvent = toPostHogEvent(event, { apiKey: 'phc_xxx' })\n",[475,2401,2402,2431,2435,2440,2452,2466,2472,2476,2481,2493,2507,2513,2518,2524],{"__ignoreMap":473},[478,2403,2404,2406,2408,2411,2413,2416,2418,2421,2423,2425,2427,2429],{"class":480,"line":481},[478,2405,485],{"class":484},[478,2407,489],{"class":488},[478,2409,2410],{"class":492}," sendToPostHogEvents",[478,2412,678],{"class":488},[478,2414,2415],{"class":492}," sendBatchToPostHogEvents",[478,2417,678],{"class":488},[478,2419,2420],{"class":492}," toPostHogEvent",[478,2422,496],{"class":488},[478,2424,499],{"class":484},[478,2426,502],{"class":488},[478,2428,506],{"class":505},[478,2430,509],{"class":488},[478,2432,2433],{"class":480,"line":593},[478,2434,616],{"emptyLinePlaceholder":615},[478,2436,2437],{"class":480,"line":612},[478,2438,2439],{"class":589},"\u002F\u002F Send a single custom event\n",[478,2441,2442,2444,2446,2448,2450],{"class":480,"line":619},[478,2443,971],{"class":484},[478,2445,2410],{"class":628},[478,2447,2322],{"class":492},[478,2449,678],{"class":488},[478,2451,647],{"class":488},[478,2453,2454,2456,2458,2460,2462,2464],{"class":480,"line":650},[478,2455,2331],{"class":667},[478,2457,791],{"class":488},[478,2459,502],{"class":488},[478,2461,2338],{"class":505},[478,2463,670],{"class":488},[478,2465,801],{"class":488},[478,2467,2468,2470],{"class":480,"line":686},[478,2469,689],{"class":488},[478,2471,692],{"class":492},[478,2473,2474],{"class":480,"line":804},[478,2475,616],{"emptyLinePlaceholder":615},[478,2477,2478],{"class":480,"line":819},[478,2479,2480],{"class":589},"\u002F\u002F Send multiple custom events in one request\n",[478,2482,2483,2485,2487,2489,2491],{"class":480,"line":2360},[478,2484,971],{"class":484},[478,2486,2415],{"class":628},[478,2488,2367],{"class":492},[478,2490,678],{"class":488},[478,2492,647],{"class":488},[478,2494,2495,2497,2499,2501,2503,2505],{"class":480,"line":2374},[478,2496,2331],{"class":667},[478,2498,791],{"class":488},[478,2500,502],{"class":488},[478,2502,2338],{"class":505},[478,2504,670],{"class":488},[478,2506,801],{"class":488},[478,2508,2509,2511],{"class":480,"line":2389},[478,2510,689],{"class":488},[478,2512,692],{"class":492},[478,2514,2516],{"class":480,"line":2515},12,[478,2517,616],{"emptyLinePlaceholder":615},[478,2519,2521],{"class":480,"line":2520},13,[478,2522,2523],{"class":589},"\u002F\u002F Convert event to PostHog format (for inspection)\n",[478,2525,2527,2529,2532,2534,2536,2538,2540,2542,2545,2547,2549,2551,2553,2555],{"class":480,"line":2526},14,[478,2528,1364],{"class":643},[478,2530,2531],{"class":492}," posthogEvent ",[478,2533,568],{"class":488},[478,2535,2420],{"class":628},[478,2537,2322],{"class":492},[478,2539,678],{"class":488},[478,2541,489],{"class":488},[478,2543,2544],{"class":667}," apiKey",[478,2546,791],{"class":488},[478,2548,502],{"class":488},[478,2550,2338],{"class":505},[478,2552,670],{"class":488},[478,2554,496],{"class":488},[478,2556,692],{"class":492},[460,2558,2560],{"id":2559},"next-steps","Next Steps",[1506,2562,2563,2569,2575,2580],{},[426,2564,2565,2568],{},[402,2566,2567],{"href":304},"Axiom Adapter"," - Send logs to Axiom",[426,2570,2571,2574],{},[402,2572,2573],{"href":309},"OTLP Adapter"," - Send logs via OpenTelemetry Protocol",[426,2576,2577,2579],{},[402,2578,368],{"href":369}," - Build your own adapter",[426,2581,2582,2584],{},[402,2583,185],{"href":186}," - Security and production tips",[2586,2587,2588],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}",{"title":473,"searchDepth":593,"depth":593,"links":2590},[2591,2592,2597,2603,2604,2605,2606,2612,2617,2618],{"id":462,"depth":593,"text":15},{"id":512,"depth":593,"text":20,"children":2593},[2594,2595,2596],{"id":516,"depth":612,"text":517},{"id":551,"depth":612,"text":552},{"id":574,"depth":612,"text":575},{"id":1159,"depth":593,"text":170,"children":2598},[2599,2600,2601,2602],{"id":1199,"depth":612,"text":1200},{"id":1257,"depth":612,"text":1258},{"id":1349,"depth":612,"text":1350},{"id":1413,"depth":612,"text":1414},{"id":1493,"depth":593,"text":1494},{"id":1539,"depth":593,"text":1540},{"id":1616,"depth":593,"text":1617},{"id":1640,"depth":593,"text":1641,"children":2607},[2608,2609,2610,2611],{"id":1752,"depth":612,"text":1753},{"id":1860,"depth":612,"text":1861},{"id":1955,"depth":612,"text":1956},{"id":1991,"depth":612,"text":1992},{"id":2200,"depth":593,"text":2201,"children":2613},[2614,2615,2616],{"id":2204,"depth":612,"text":2205},{"id":2220,"depth":612,"text":2221},{"id":2247,"depth":612,"text":2248},{"id":2270,"depth":593,"text":2271},{"id":2559,"depth":593,"text":2560},"Send wide events to PostHog Logs via OTLP for structured log querying, debugging, and observability in your PostHog dashboard.","md",[2622,2628],{"label":2623,"icon":2624,"to":525,"target":2625,"color":2626,"variant":2627},"PostHog Dashboard","i-lucide-external-link","_blank","neutral","subtle",{"label":2567,"icon":306,"to":304,"color":2626,"variant":2627},{},{"title":313,"icon":316},{"title":394,"description":2619},"fYVVjcq01ssaJ-u5ilVjdm6h_4SkWKFcC3Nqx6cL0sE",[2634,2636],{"title":308,"path":309,"stem":310,"description":2635,"icon":311,"children":-1},"Send logs via OpenTelemetry Protocol (OTLP) to Grafana, Datadog, Honeycomb, and any compatible backend. Supports gRPC and HTTP transports.",{"title":318,"path":319,"stem":320,"description":2637,"icon":321,"children":-1},"Send structured logs to Sentry Logs for high-cardinality querying and debugging. Zero-config setup with environment variables.",1778106403216]