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