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