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