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