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