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