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