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