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