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