[{"data":1,"prerenderedAt":3474},["ShallowReactive",2],{"navigation_docs":3,"-integrate-adapters-cloud-posthog":534,"-integrate-adapters-cloud-posthog-surround":3469},[4,30,80,128,308,440,499],{"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},"CLI","\u002Fcli","3.cli",[85,88,93,98,103,108,113,118,123],{"title":36,"path":86,"stem":87,"icon":44},"\u002Fcli\u002Foverview","3.cli\u002F0.overview",{"title":89,"path":90,"stem":91,"icon":92},"init","\u002Fcli\u002Finit","3.cli\u002F1.init","i-lucide-wand-sparkles",{"title":94,"path":95,"stem":96,"icon":97},"map","\u002Fcli\u002Fmap","3.cli\u002F2.map","i-lucide-radar",{"title":99,"path":100,"stem":101,"icon":102},"Rules","\u002Fcli\u002Frules","3.cli\u002F3.rules","i-lucide-list-checks",{"title":104,"path":105,"stem":106,"icon":107},"Scoring","\u002Fcli\u002Fscoring","3.cli\u002F4.scoring","i-lucide-gauge",{"title":109,"path":110,"stem":111,"icon":112},"CI","\u002Fcli\u002Fci","3.cli\u002F5.ci","i-lucide-git-pull-request",{"title":114,"path":115,"stem":116,"icon":117},"doctor","\u002Fcli\u002Fdoctor","3.cli\u002F6.doctor","i-lucide-stethoscope",{"title":119,"path":120,"stem":121,"icon":122},"telemetry","\u002Fcli\u002Ftelemetry","3.cli\u002F7.telemetry","i-lucide-bar-chart-3",{"title":124,"path":125,"stem":126,"icon":127},"agents","\u002Fcli\u002Fagents","3.cli\u002F8.agents","i-lucide-bot",{"title":129,"path":130,"stem":131,"children":132,"page":29},"Integrate","\u002Fintegrate","4.integrate",[133,137,220],{"title":36,"path":134,"stem":135,"icon":136},"\u002Fintegrate\u002Foverview","4.integrate\u002F0.overview","i-lucide-plug",{"title":138,"path":139,"stem":140,"children":141,"page":29},"Adapters","\u002Fintegrate\u002Fadapters","4.integrate\u002Fadapters",[142,145,175,200],{"title":36,"path":143,"stem":144,"icon":39},"\u002Fintegrate\u002Fadapters\u002Foverview","4.integrate\u002Fadapters\u002F01.overview",{"title":146,"path":147,"stem":148,"children":149,"page":29},"Cloud","\u002Fintegrate\u002Fadapters\u002Fcloud","4.integrate\u002Fadapters\u002Fcloud",[150,155,160,165,170],{"title":151,"path":152,"stem":153,"icon":154},"Axiom","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Faxiom","4.integrate\u002Fadapters\u002Fcloud\u002F01.axiom","i-custom-axiom",{"title":156,"path":157,"stem":158,"icon":159},"PostHog","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fposthog","4.integrate\u002Fadapters\u002Fcloud\u002F02.posthog","i-simple-icons-posthog",{"title":161,"path":162,"stem":163,"icon":164},"Sentry","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fsentry","4.integrate\u002Fadapters\u002Fcloud\u002F03.sentry","i-simple-icons-sentry",{"title":166,"path":167,"stem":168,"icon":169},"Better Stack","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fbetter-stack","4.integrate\u002Fadapters\u002Fcloud\u002F04.better-stack","i-simple-icons-betterstack",{"title":171,"path":172,"stem":173,"icon":174},"Datadog","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fdatadog","4.integrate\u002Fadapters\u002Fcloud\u002F05.datadog","i-simple-icons-datadog",{"title":176,"path":177,"stem":178,"children":179,"page":29},"Cloud or Self-Hosted","\u002Fintegrate\u002Fadapters\u002Fhybrid","4.integrate\u002Fadapters\u002Fhybrid",[180,185,190,195],{"title":181,"path":182,"stem":183,"icon":184},"Grafana Loki","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Floki","4.integrate\u002Fadapters\u002Fhybrid\u002F01.loki","i-simple-icons-grafana",{"title":186,"path":187,"stem":188,"icon":189},"ClickHouse","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Fclickhouse","4.integrate\u002Fadapters\u002Fhybrid\u002F02.clickhouse","i-simple-icons-clickhouse",{"title":191,"path":192,"stem":193,"icon":194},"OTLP","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Fotlp","4.integrate\u002Fadapters\u002Fhybrid\u002F03.otlp","i-simple-icons-opentelemetry",{"title":196,"path":197,"stem":198,"icon":199},"HyperDX","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Fhyperdx","4.integrate\u002Fadapters\u002Fhybrid\u002F04.hyperdx","i-custom-hyperdx",{"title":201,"path":202,"stem":203,"children":204,"page":29},"Self-Hosted","\u002Fintegrate\u002Fadapters\u002Fself-hosted","4.integrate\u002Fadapters\u002Fself-hosted",[205,210,215],{"title":206,"path":207,"stem":208,"icon":209},"File System","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Ffs","4.integrate\u002Fadapters\u002Fself-hosted\u002F01.fs","i-lucide-hard-drive",{"title":211,"path":212,"stem":213,"icon":214},"NuxtHub","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Fnuxthub","4.integrate\u002Fadapters\u002Fself-hosted\u002F02.nuxthub","i-simple-icons-nuxt",{"title":216,"path":217,"stem":218,"icon":219},"Memory","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Fmemory","4.integrate\u002Fadapters\u002Fself-hosted\u002F03.memory","i-lucide-cpu",{"title":221,"path":222,"stem":223,"children":224,"page":29},"Frameworks","\u002Fintegrate\u002Fframeworks","4.integrate\u002Fframeworks",[225,229,234,239,244,249,254,259,264,269,274,279,284,289,293,298,303],{"title":36,"path":226,"stem":227,"icon":228},"\u002Fintegrate\u002Fframeworks\u002Foverview","4.integrate\u002Fframeworks\u002F00.overview","i-lucide-layout-grid",{"title":230,"path":231,"stem":232,"icon":233},"Nuxt","\u002Fintegrate\u002Fframeworks\u002Fnuxt","4.integrate\u002Fframeworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":235,"path":236,"stem":237,"icon":238},"Next.js","\u002Fintegrate\u002Fframeworks\u002Fnextjs","4.integrate\u002Fframeworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":240,"path":241,"stem":242,"icon":243},"SvelteKit","\u002Fintegrate\u002Fframeworks\u002Fsveltekit","4.integrate\u002Fframeworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":245,"path":246,"stem":247,"icon":248},"Nitro","\u002Fintegrate\u002Fframeworks\u002Fnitro","4.integrate\u002Fframeworks\u002F04.nitro","i-custom-nitro",{"title":250,"path":251,"stem":252,"icon":253},"TanStack Start","\u002Fintegrate\u002Fframeworks\u002Ftanstack-start","4.integrate\u002Fframeworks\u002F05.tanstack-start","i-custom-tanstack",{"title":255,"path":256,"stem":257,"icon":258},"NestJS","\u002Fintegrate\u002Fframeworks\u002Fnestjs","4.integrate\u002Fframeworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":260,"path":261,"stem":262,"icon":263},"Express","\u002Fintegrate\u002Fframeworks\u002Fexpress","4.integrate\u002Fframeworks\u002F07.express","i-simple-icons-express",{"title":265,"path":266,"stem":267,"icon":268},"Hono","\u002Fintegrate\u002Fframeworks\u002Fhono","4.integrate\u002Fframeworks\u002F08.hono","i-simple-icons-hono",{"title":270,"path":271,"stem":272,"icon":273},"Fastify","\u002Fintegrate\u002Fframeworks\u002Ffastify","4.integrate\u002Fframeworks\u002F09.fastify","i-simple-icons-fastify",{"title":275,"path":276,"stem":277,"icon":278},"Elysia","\u002Fintegrate\u002Fframeworks\u002Felysia","4.integrate\u002Fframeworks\u002F10.elysia","i-custom-elysia",{"title":280,"path":281,"stem":282,"icon":283},"React Router","\u002Fintegrate\u002Fframeworks\u002Freact-router","4.integrate\u002Fframeworks\u002F11.react-router","i-custom-reactrouter",{"title":285,"path":286,"stem":287,"icon":288},"Cloudflare Workers","\u002Fintegrate\u002Fframeworks\u002Fcloudflare-workers","4.integrate\u002Fframeworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":290,"path":291,"stem":292,"icon":74},"Standalone","\u002Fintegrate\u002Fframeworks\u002Fstandalone","4.integrate\u002Fframeworks\u002F13.standalone",{"title":294,"path":295,"stem":296,"icon":297},"Astro","\u002Fintegrate\u002Fframeworks\u002Fastro","4.integrate\u002Fframeworks\u002F14.astro","i-simple-icons-astro",{"title":299,"path":300,"stem":301,"icon":302},"oRPC","\u002Fintegrate\u002Fframeworks\u002Forpc","4.integrate\u002Fframeworks\u002F15.orpc","i-lucide-network",{"title":304,"path":305,"stem":306,"icon":307},"AWS Lambda","\u002Fintegrate\u002Fframeworks\u002Faws-lambda","4.integrate\u002Fframeworks\u002F16.aws-lambda","i-custom-lambda",{"title":309,"path":310,"stem":311,"children":312,"page":29},"Use Cases","\u002Fuse-cases","5.use-cases",[313,316,321,350,377,409,430,435],{"title":36,"path":314,"stem":315,"icon":102},"\u002Fuse-cases\u002Foverview","5.use-cases\u002F0.overview",{"title":317,"path":318,"stem":319,"icon":320},"Client Logging","\u002Fuse-cases\u002Fclient-logging","5.use-cases\u002F1.client-logging","i-lucide-monitor",{"title":322,"icon":323,"path":324,"stem":325,"children":326,"page":29},"AI SDK","i-simple-icons-vercel","\u002Fuse-cases\u002Fai-sdk","5.use-cases\u002F2.ai-sdk",[327,330,335,340,345],{"title":36,"path":328,"stem":329,"icon":39},"\u002Fuse-cases\u002Fai-sdk\u002Foverview","5.use-cases\u002F2.ai-sdk\u002F01.overview",{"title":331,"path":332,"stem":333,"icon":334},"Usage","\u002Fuse-cases\u002Fai-sdk\u002Fusage","5.use-cases\u002F2.ai-sdk\u002F02.usage","i-lucide-code",{"title":336,"path":337,"stem":338,"icon":339},"Options","\u002Fuse-cases\u002Fai-sdk\u002Foptions","5.use-cases\u002F2.ai-sdk\u002F03.options","i-lucide-sliders",{"title":341,"path":342,"stem":343,"icon":344},"Metadata","\u002Fuse-cases\u002Fai-sdk\u002Fmetadata","5.use-cases\u002F2.ai-sdk\u002F04.metadata","i-lucide-database",{"title":346,"path":347,"stem":348,"icon":349},"Telemetry","\u002Fuse-cases\u002Fai-sdk\u002Ftelemetry","5.use-cases\u002F2.ai-sdk\u002F05.telemetry","i-lucide-activity",{"title":351,"icon":352,"path":353,"stem":354,"children":355,"page":29},"Better Auth","i-simple-icons-betterauth","\u002Fuse-cases\u002Fbetter-auth","5.use-cases\u002F3.better-auth",[356,359,364,369,373],{"title":36,"path":357,"stem":358,"icon":39},"\u002Fuse-cases\u002Fbetter-auth\u002Foverview","5.use-cases\u002F3.better-auth\u002F01.overview",{"title":360,"path":361,"stem":362,"icon":363},"Identify User","\u002Fuse-cases\u002Fbetter-auth\u002Fidentify-user","5.use-cases\u002F3.better-auth\u002F02.identify-user","i-lucide-user-check",{"title":365,"path":366,"stem":367,"icon":368},"Middleware","\u002Fuse-cases\u002Fbetter-auth\u002Fmiddleware","5.use-cases\u002F3.better-auth\u002F03.middleware","i-lucide-shield",{"title":370,"path":371,"stem":372,"icon":320},"Client Sync","\u002Fuse-cases\u002Fbetter-auth\u002Fclient-sync","5.use-cases\u002F3.better-auth\u002F04.client-sync",{"title":374,"path":375,"stem":376,"icon":107},"Performance","\u002Fuse-cases\u002Fbetter-auth\u002Fperformance","5.use-cases\u002F3.better-auth\u002F05.performance",{"title":378,"icon":379,"path":380,"stem":381,"children":382,"page":29},"Audit Logs","i-lucide-shield-check","\u002Fuse-cases\u002Faudit","5.use-cases\u002F4.audit",[383,386,391,396,401,405],{"title":36,"path":384,"stem":385,"icon":39},"\u002Fuse-cases\u002Faudit\u002Foverview","5.use-cases\u002F4.audit\u002F01.overview",{"title":387,"path":388,"stem":389,"icon":390},"Schema","\u002Fuse-cases\u002Faudit\u002Fschema","5.use-cases\u002F4.audit\u002F02.schema","i-lucide-file-text",{"title":392,"path":393,"stem":394,"icon":395},"Recording","\u002Fuse-cases\u002Faudit\u002Frecording","5.use-cases\u002F4.audit\u002F03.recording","i-lucide-pen-line",{"title":397,"path":398,"stem":399,"icon":400},"Drains","\u002Fuse-cases\u002Faudit\u002Fpipeline","5.use-cases\u002F4.audit\u002F04.pipeline","i-lucide-link",{"title":402,"path":403,"stem":404,"icon":379},"Compliance","\u002Fuse-cases\u002Faudit\u002Fcompliance","5.use-cases\u002F4.audit\u002F05.compliance",{"title":406,"path":407,"stem":408,"icon":79},"Recipes","\u002Fuse-cases\u002Faudit\u002Frecipes","5.use-cases\u002F4.audit\u002F06.recipes",{"title":346,"icon":107,"path":410,"stem":411,"children":412,"page":29},"\u002Fuse-cases\u002Ftelemetry","5.use-cases\u002F4.telemetry",[413,416,421,426],{"title":36,"path":414,"stem":415,"icon":39},"\u002Fuse-cases\u002Ftelemetry\u002Foverview","5.use-cases\u002F4.telemetry\u002F01.overview",{"title":417,"path":418,"stem":419,"icon":420},"Setup","\u002Fuse-cases\u002Ftelemetry\u002Fsetup","5.use-cases\u002F4.telemetry\u002F02.setup","i-lucide-wrench",{"title":422,"path":423,"stem":424,"icon":425},"Ingest","\u002Fuse-cases\u002Ftelemetry\u002Fingest","5.use-cases\u002F4.telemetry\u002F03.ingest","i-lucide-server",{"title":427,"path":428,"stem":429,"icon":79},"Reference","\u002Fuse-cases\u002Ftelemetry\u002Freference","5.use-cases\u002F4.telemetry\u002F04.reference",{"title":431,"path":432,"stem":433,"icon":434},"Enrichers","\u002Fuse-cases\u002Fenrichers","5.use-cases\u002F5.enrichers","i-lucide-sparkles",{"title":436,"path":437,"stem":438,"icon":439},"eve","\u002Fuse-cases\u002Feve","5.use-cases\u002F5.eve","i-custom-eve",{"title":441,"path":442,"stem":443,"children":444,"page":29},"Extend","\u002Fextend","6.extend",[445,449,454,459,463,468,472,476,480,484,489,494],{"title":36,"path":446,"stem":447,"icon":448},"\u002Fextend\u002Foverview","6.extend\u002F0.overview","i-lucide-blocks",{"title":450,"path":451,"stem":452,"icon":453},"Stream","\u002Fextend\u002Fstream","6.extend\u002F1.stream","i-lucide-radio-tower",{"title":455,"path":456,"stem":457,"icon":458},"Custom framework","\u002Fextend\u002Fcustom-framework","6.extend\u002F10.custom-framework","i-lucide-puzzle",{"title":460,"path":461,"stem":462,"icon":453},"Diagnostics channel","\u002Fextend\u002Fdiagnostics-channel","6.extend\u002F11.diagnostics-channel",{"title":464,"path":465,"stem":466,"icon":467},"FS reader","\u002Fextend\u002Ffs-reader","6.extend\u002F2.fs-reader","i-lucide-folder-search",{"title":406,"path":469,"stem":470,"icon":471},"\u002Fextend\u002Fconsumer-recipes","6.extend\u002F3.consumer-recipes","i-lucide-chef-hat",{"title":473,"path":474,"stem":475,"icon":448},"Plugins","\u002Fextend\u002Fplugins","6.extend\u002F4.plugins",{"title":477,"path":478,"stem":479,"icon":434},"Custom enrichers","\u002Fextend\u002Fcustom-enrichers","6.extend\u002F5.custom-enrichers",{"title":481,"path":482,"stem":483,"icon":64},"Tail sampling","\u002Fextend\u002Ftail-sampling","6.extend\u002F6.tail-sampling",{"title":485,"path":486,"stem":487,"icon":488},"Identity headers","\u002Fextend\u002Fidentity-headers","6.extend\u002F7.identity-headers","i-lucide-fingerprint",{"title":490,"path":491,"stem":492,"icon":493},"Custom drains","\u002Fextend\u002Fcustom-drains","6.extend\u002F8.custom-drains","i-lucide-share-2",{"title":495,"path":496,"stem":497,"icon":498},"Drain pipeline","\u002Fextend\u002Fdrain-pipeline","6.extend\u002F9.drain-pipeline","i-lucide-workflow",{"title":427,"path":500,"stem":501,"children":502,"page":29},"\u002Freference","7.reference",[503,508,511,516,520,525,529],{"title":504,"path":505,"stem":506,"icon":507},"Configuration","\u002Freference\u002Fconfiguration","7.reference\u002F1.configuration","i-lucide-settings",{"title":374,"path":509,"stem":510,"icon":107},"\u002Freference\u002Fperformance","7.reference\u002F2.performance",{"title":512,"path":513,"stem":514,"icon":515},"Vite Plugin","\u002Freference\u002Fvite-plugin","7.reference\u002F3.vite-plugin","i-custom-vite",{"title":517,"path":518,"stem":519,"icon":379},"Best Practices","\u002Freference\u002Fbest-practices","7.reference\u002F4.best-practices",{"title":521,"path":522,"stem":523,"icon":524},"vs Other Loggers","\u002Freference\u002Fvs-other-loggers","7.reference\u002F5.vs-other-loggers","i-lucide-scale",{"title":526,"path":527,"stem":528,"icon":434},"Agent Skills","\u002Freference\u002Fagent-skills","7.reference\u002F6.agent-skills",{"title":530,"path":531,"stem":532,"icon":533},"Cost","\u002Freference\u002Fcost","7.reference\u002F7.cost","i-lucide-receipt",{"id":535,"title":536,"body":537,"description":3455,"extension":3456,"links":3457,"meta":3465,"navigation":3466,"path":157,"seo":3467,"stem":158,"__hash__":3468},"docs\u002F4.integrate\u002Fadapters\u002Fcloud\u002F02.posthog.md","PostHog Adapter",{"type":538,"value":539,"toc":3420},"minimark",[540,556,601,605,608,652,655,660,691,695,714,718,1296,1299,1302,1305,1335,1339,1380,1384,1391,1472,1476,1479,1536,1540,1713,1717,1727,1771,1775,1790,1803,1837,1840,1850,1854,1861,1870,1953,1960,2064,2068,2071,2128,2135,2171,2177,2192,2196,2202,2242,2270,2274,2280,2293,2297,2306,2401,2412,2418,2434,2438,2557,2561,2564,2652,2656,2662,2692,2696,2703,2714,2805,2808,2812,2886,2889,3028,3032,3036,3045,3048,3052,3055,3075,3079,3085,3098,3102,3105,3224,3227,3387,3391,3416],[541,542,543,549,550,555],"p",{},[544,545,156],"a",{"href":546,"rel":547},"https:\u002F\u002Fposthog.com",[548],"nofollow"," is an open-source product analytics platform. The evlog PostHog adapter sends your wide events to ",[544,551,554],{"href":552,"rel":553},"https:\u002F\u002Fposthog.com\u002Fdocs\u002Flogs",[548],"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.",[557,558,561,564,589],"prompt",{":actions":559,"description":560,"icon":159},"[\"copy\",\"cursor\",\"claude\"]","Add the PostHog drain adapter",[541,562,563],{},"Add the PostHog drain adapter to send evlog wide events to PostHog Logs.",[565,566,567,571,574,577,580,583,586],"ol",{},[568,569,570],"li",{},"Identify which framework I'm using and follow its evlog integration pattern",[568,572,573],{},"Install evlog if not already installed",[568,575,576],{},"Import createPostHogDrain from 'evlog\u002Fposthog'",[568,578,579],{},"Wire createPostHogDrain() into my framework's drain configuration",[568,581,582],{},"Set POSTHOG_API_KEY environment variable",[568,584,585],{},"Optionally set POSTHOG_HOST for EU or self-hosted instances",[568,587,588],{},"Test by triggering a request and checking PostHog > Logs",[541,590,591,592,596,597],{},"Adapter docs: ",[544,593,594],{"href":594,"rel":595},"https:\u002F\u002Fwww.evlog.dev\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fposthog",[548],"\nFramework setup: ",[544,598,599],{"href":599,"rel":600},"https:\u002F\u002Fwww.evlog.dev\u002Fintegrate\u002Fframeworks\u002Foverview",[548],[602,603,20],"h2",{"id":604},"installation",[541,606,607],{},"The PostHog adapter comes bundled with evlog:",[609,610,616],"pre",{"className":611,"code":612,"filename":613,"language":614,"meta":615,"style":615},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { createPostHogDrain } from 'evlog\u002Fposthog'\n","src\u002Findex.ts","typescript","",[617,618,619],"code",{"__ignoreMap":615},[620,621,624,628,632,636,639,642,645,649],"span",{"class":622,"line":623},"line",1,[620,625,627],{"class":626},"s7zQu","import",[620,629,631],{"class":630},"sMK4o"," {",[620,633,635],{"class":634},"sTEyZ"," createPostHogDrain",[620,637,638],{"class":630}," }",[620,640,641],{"class":626}," from",[620,643,644],{"class":630}," '",[620,646,648],{"class":647},"sfazB","evlog\u002Fposthog",[620,650,651],{"class":630},"'\n",[602,653,25],{"id":654},"quick-start",[656,657,659],"h3",{"id":658},"_1-get-your-posthog-project-api-key","1. Get your PostHog project API key",[565,661,662,670,684],{},[568,663,664,665],{},"Log in to your ",[544,666,669],{"href":667,"rel":668},"https:\u002F\u002Fapp.posthog.com",[548],"PostHog dashboard",[568,671,672,673,677,678,677,681],{},"Go to ",[674,675,676],"strong",{},"Settings"," > ",[674,679,680],{},"Project",[674,682,683],{},"Project API Key",[568,685,686,687,690],{},"Copy the key (starts with ",[617,688,689],{},"phc_",")",[656,692,694],{"id":693},"_2-set-environment-variables","2. Set environment variables",[609,696,701],{"className":697,"code":698,"filename":699,"language":700,"meta":615,"style":615},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","POSTHOG_API_KEY=phc_your-project-api-key\n",".env","bash",[617,702,703],{"__ignoreMap":615},[620,704,705,708,711],{"class":622,"line":623},[620,706,707],{"class":634},"POSTHOG_API_KEY",[620,709,710],{"class":630},"=",[620,712,713],{"class":647},"phc_your-project-api-key\n",[656,715,717],{"id":716},"_3-wire-the-drain-to-your-framework","3. Wire the drain to your framework",[719,720,721,835,966,1028,1082,1141,1195,1248],"code-group",{},[609,722,725],{"className":611,"code":723,"filename":724,"language":614,"meta":615,"style":615},"\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",[617,726,727,733,752,759,790,826],{"__ignoreMap":615},[620,728,729],{"class":622,"line":623},[620,730,732],{"class":731},"sHwdD","\u002F\u002F server\u002Fplugins\u002Fevlog-drain.ts\n",[620,734,736,738,740,742,744,746,748,750],{"class":622,"line":735},2,[620,737,627],{"class":626},[620,739,631],{"class":630},[620,741,635],{"class":634},[620,743,638],{"class":630},[620,745,641],{"class":626},[620,747,644],{"class":630},[620,749,648],{"class":647},[620,751,651],{"class":630},[620,753,755],{"class":622,"line":754},3,[620,756,758],{"emptyLinePlaceholder":757},true,"\n",[620,760,762,765,768,772,775,777,781,783,787],{"class":622,"line":761},4,[620,763,764],{"class":626},"export",[620,766,767],{"class":626}," default",[620,769,771],{"class":770},"s2Zo4"," defineNitroPlugin",[620,773,774],{"class":634},"(",[620,776,774],{"class":630},[620,778,780],{"class":779},"sHdIc","nitroApp",[620,782,690],{"class":630},[620,784,786],{"class":785},"spNyl"," =>",[620,788,789],{"class":630}," {\n",[620,791,793,796,799,802,804,807,810,813,816,818,821,823],{"class":622,"line":792},5,[620,794,795],{"class":634},"  nitroApp",[620,797,798],{"class":630},".",[620,800,801],{"class":634},"hooks",[620,803,798],{"class":630},[620,805,806],{"class":770},"hook",[620,808,774],{"class":809},"swJcz",[620,811,812],{"class":630},"'",[620,814,815],{"class":647},"evlog:drain",[620,817,812],{"class":630},[620,819,820],{"class":630},",",[620,822,635],{"class":770},[620,824,825],{"class":809},"())\n",[620,827,829,832],{"class":622,"line":828},6,[620,830,831],{"class":630},"}",[620,833,834],{"class":634},")\n",[609,836,838],{"className":611,"code":837,"filename":235,"language":614,"meta":615,"style":615},"\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",[617,839,840,845,865,883,887,926,944,959],{"__ignoreMap":615},[620,841,842],{"class":622,"line":623},[620,843,844],{"class":731},"\u002F\u002F lib\u002Fevlog.ts\n",[620,846,847,849,851,854,856,858,860,863],{"class":622,"line":735},[620,848,627],{"class":626},[620,850,631],{"class":630},[620,852,853],{"class":634}," createEvlog",[620,855,638],{"class":630},[620,857,641],{"class":626},[620,859,644],{"class":630},[620,861,862],{"class":647},"evlog\u002Fnext",[620,864,651],{"class":630},[620,866,867,869,871,873,875,877,879,881],{"class":622,"line":754},[620,868,627],{"class":626},[620,870,631],{"class":630},[620,872,635],{"class":634},[620,874,638],{"class":630},[620,876,641],{"class":626},[620,878,644],{"class":630},[620,880,648],{"class":647},[620,882,651],{"class":630},[620,884,885],{"class":622,"line":761},[620,886,758],{"emptyLinePlaceholder":757},[620,888,889,891,894,896,899,901,904,906,909,911,914,916,919,921,923],{"class":622,"line":792},[620,890,764],{"class":626},[620,892,893],{"class":785}," const",[620,895,631],{"class":630},[620,897,898],{"class":634}," withEvlog",[620,900,820],{"class":630},[620,902,903],{"class":634}," useLogger",[620,905,820],{"class":630},[620,907,908],{"class":634}," log",[620,910,820],{"class":630},[620,912,913],{"class":634}," createError ",[620,915,831],{"class":630},[620,917,918],{"class":630}," =",[620,920,853],{"class":770},[620,922,774],{"class":634},[620,924,925],{"class":630},"{\n",[620,927,928,931,934,936,939,941],{"class":622,"line":828},[620,929,930],{"class":809},"  service",[620,932,933],{"class":630},":",[620,935,644],{"class":630},[620,937,938],{"class":647},"my-app",[620,940,812],{"class":630},[620,942,943],{"class":630},",\n",[620,945,947,950,952,954,957],{"class":622,"line":946},7,[620,948,949],{"class":809},"  drain",[620,951,933],{"class":630},[620,953,635],{"class":770},[620,955,956],{"class":634},"()",[620,958,943],{"class":630},[620,960,962,964],{"class":622,"line":961},8,[620,963,831],{"class":630},[620,965,834],{"class":634},[609,967,969],{"className":611,"code":968,"filename":265,"language":614,"meta":615,"style":615},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\napp.use(evlog({ drain: createPostHogDrain() }))\n",[617,970,971,989,993],{"__ignoreMap":615},[620,972,973,975,977,979,981,983,985,987],{"class":622,"line":623},[620,974,627],{"class":626},[620,976,631],{"class":630},[620,978,635],{"class":634},[620,980,638],{"class":630},[620,982,641],{"class":626},[620,984,644],{"class":630},[620,986,648],{"class":647},[620,988,651],{"class":630},[620,990,991],{"class":622,"line":735},[620,992,758],{"emptyLinePlaceholder":757},[620,994,995,998,1000,1003,1005,1008,1010,1013,1016,1018,1020,1023,1025],{"class":622,"line":754},[620,996,997],{"class":634},"app",[620,999,798],{"class":630},[620,1001,1002],{"class":770},"use",[620,1004,774],{"class":634},[620,1006,1007],{"class":770},"evlog",[620,1009,774],{"class":634},[620,1011,1012],{"class":630},"{",[620,1014,1015],{"class":809}," drain",[620,1017,933],{"class":630},[620,1019,635],{"class":770},[620,1021,1022],{"class":634},"() ",[620,1024,831],{"class":630},[620,1026,1027],{"class":634},"))\n",[609,1029,1030],{"className":611,"code":968,"filename":260,"language":614,"meta":615,"style":615},[617,1031,1032,1050,1054],{"__ignoreMap":615},[620,1033,1034,1036,1038,1040,1042,1044,1046,1048],{"class":622,"line":623},[620,1035,627],{"class":626},[620,1037,631],{"class":630},[620,1039,635],{"class":634},[620,1041,638],{"class":630},[620,1043,641],{"class":626},[620,1045,644],{"class":630},[620,1047,648],{"class":647},[620,1049,651],{"class":630},[620,1051,1052],{"class":622,"line":735},[620,1053,758],{"emptyLinePlaceholder":757},[620,1055,1056,1058,1060,1062,1064,1066,1068,1070,1072,1074,1076,1078,1080],{"class":622,"line":754},[620,1057,997],{"class":634},[620,1059,798],{"class":630},[620,1061,1002],{"class":770},[620,1063,774],{"class":634},[620,1065,1007],{"class":770},[620,1067,774],{"class":634},[620,1069,1012],{"class":630},[620,1071,1015],{"class":809},[620,1073,933],{"class":630},[620,1075,635],{"class":770},[620,1077,1022],{"class":634},[620,1079,831],{"class":630},[620,1081,1027],{"class":634},[609,1083,1085],{"className":611,"code":1084,"filename":270,"language":614,"meta":615,"style":615},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\nawait app.register(evlog, { drain: createPostHogDrain() })\n",[617,1086,1087,1105,1109],{"__ignoreMap":615},[620,1088,1089,1091,1093,1095,1097,1099,1101,1103],{"class":622,"line":623},[620,1090,627],{"class":626},[620,1092,631],{"class":630},[620,1094,635],{"class":634},[620,1096,638],{"class":630},[620,1098,641],{"class":626},[620,1100,644],{"class":630},[620,1102,648],{"class":647},[620,1104,651],{"class":630},[620,1106,1107],{"class":622,"line":735},[620,1108,758],{"emptyLinePlaceholder":757},[620,1110,1111,1114,1117,1119,1122,1125,1127,1129,1131,1133,1135,1137,1139],{"class":622,"line":754},[620,1112,1113],{"class":626},"await",[620,1115,1116],{"class":634}," app",[620,1118,798],{"class":630},[620,1120,1121],{"class":770},"register",[620,1123,1124],{"class":634},"(evlog",[620,1126,820],{"class":630},[620,1128,631],{"class":630},[620,1130,1015],{"class":809},[620,1132,933],{"class":630},[620,1134,635],{"class":770},[620,1136,1022],{"class":634},[620,1138,831],{"class":630},[620,1140,834],{"class":634},[609,1142,1143],{"className":611,"code":968,"filename":275,"language":614,"meta":615,"style":615},[617,1144,1145,1163,1167],{"__ignoreMap":615},[620,1146,1147,1149,1151,1153,1155,1157,1159,1161],{"class":622,"line":623},[620,1148,627],{"class":626},[620,1150,631],{"class":630},[620,1152,635],{"class":634},[620,1154,638],{"class":630},[620,1156,641],{"class":626},[620,1158,644],{"class":630},[620,1160,648],{"class":647},[620,1162,651],{"class":630},[620,1164,1165],{"class":622,"line":735},[620,1166,758],{"emptyLinePlaceholder":757},[620,1168,1169,1171,1173,1175,1177,1179,1181,1183,1185,1187,1189,1191,1193],{"class":622,"line":754},[620,1170,997],{"class":634},[620,1172,798],{"class":630},[620,1174,1002],{"class":770},[620,1176,774],{"class":634},[620,1178,1007],{"class":770},[620,1180,774],{"class":634},[620,1182,1012],{"class":630},[620,1184,1015],{"class":809},[620,1186,933],{"class":630},[620,1188,635],{"class":770},[620,1190,1022],{"class":634},[620,1192,831],{"class":630},[620,1194,1027],{"class":634},[609,1196,1198],{"className":611,"code":1197,"filename":255,"language":614,"meta":615,"style":615},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\nEvlogModule.forRoot({ drain: createPostHogDrain() })\n",[617,1199,1200,1218,1222],{"__ignoreMap":615},[620,1201,1202,1204,1206,1208,1210,1212,1214,1216],{"class":622,"line":623},[620,1203,627],{"class":626},[620,1205,631],{"class":630},[620,1207,635],{"class":634},[620,1209,638],{"class":630},[620,1211,641],{"class":626},[620,1213,644],{"class":630},[620,1215,648],{"class":647},[620,1217,651],{"class":630},[620,1219,1220],{"class":622,"line":735},[620,1221,758],{"emptyLinePlaceholder":757},[620,1223,1224,1227,1229,1232,1234,1236,1238,1240,1242,1244,1246],{"class":622,"line":754},[620,1225,1226],{"class":634},"EvlogModule",[620,1228,798],{"class":630},[620,1230,1231],{"class":770},"forRoot",[620,1233,774],{"class":634},[620,1235,1012],{"class":630},[620,1237,1015],{"class":809},[620,1239,933],{"class":630},[620,1241,635],{"class":770},[620,1243,1022],{"class":634},[620,1245,831],{"class":630},[620,1247,834],{"class":634},[609,1249,1251],{"className":611,"code":1250,"filename":290,"language":614,"meta":615,"style":615},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\ninitLogger({ drain: createPostHogDrain() })\n",[617,1252,1253,1271,1275],{"__ignoreMap":615},[620,1254,1255,1257,1259,1261,1263,1265,1267,1269],{"class":622,"line":623},[620,1256,627],{"class":626},[620,1258,631],{"class":630},[620,1260,635],{"class":634},[620,1262,638],{"class":630},[620,1264,641],{"class":626},[620,1266,644],{"class":630},[620,1268,648],{"class":647},[620,1270,651],{"class":630},[620,1272,1273],{"class":622,"line":735},[620,1274,758],{"emptyLinePlaceholder":757},[620,1276,1277,1280,1282,1284,1286,1288,1290,1292,1294],{"class":622,"line":754},[620,1278,1279],{"class":770},"initLogger",[620,1281,774],{"class":634},[620,1283,1012],{"class":630},[620,1285,1015],{"class":809},[620,1287,933],{"class":630},[620,1289,635],{"class":770},[620,1291,1022],{"class":634},[620,1293,831],{"class":630},[620,1295,834],{"class":634},[541,1297,1298],{},"That's it! Your wide events will now appear in PostHog Logs with full OTLP structure including severity levels, trace context, and structured attributes.",[602,1300,504],{"id":1301},"configuration",[541,1303,1304],{},"The adapter reads configuration from multiple sources (highest priority first):",[565,1306,1307,1316,1326],{},[568,1308,1309,1312,1313],{},[674,1310,1311],{},"Overrides"," passed to ",[617,1314,1315],{},"createPostHogDrain()",[568,1317,1318,1321,1322,1325],{},[674,1319,1320],{},"Runtime config"," at ",[617,1323,1324],{},"runtimeConfig.posthog"," (Nuxt\u002FNitro only)",[568,1327,1328,1331,1332,690],{},[674,1329,1330],{},"Environment variables"," (",[617,1333,1334],{},"POSTHOG_*",[656,1336,1338],{"id":1337},"environment-variables","Environment Variables",[1340,1341,1342,1355],"table",{},[1343,1344,1345],"thead",{},[1346,1347,1348,1352],"tr",{},[1349,1350,1351],"th",{},"Variable",[1349,1353,1354],{},"Description",[1356,1357,1358,1370],"tbody",{},[1346,1359,1360,1365],{},[1361,1362,1363],"td",{},[617,1364,707],{},[1361,1366,1367,1368,690],{},"Project API key (starts with ",[617,1369,689],{},[1346,1371,1372,1377],{},[1361,1373,1374],{},[617,1375,1376],{},"POSTHOG_HOST",[1361,1378,1379],{},"PostHog host URL (for EU or self-hosted)",[656,1381,1383],{"id":1382},"runtime-config-nuxt-only","Runtime Config (Nuxt only)",[541,1385,1386,1387,1390],{},"Configure via ",[617,1388,1389],{},"nuxt.config.ts"," for type-safe configuration:",[609,1392,1394],{"className":611,"code":1393,"filename":1389,"language":614,"meta":615,"style":615},"export default defineNuxtConfig({\n  runtimeConfig: {\n    posthog: {\n      apiKey: '', \u002F\u002F Set via POSTHOG_API_KEY\n      host: '', \u002F\u002F Set via POSTHOG_HOST\n    },\n  },\n})\n",[617,1395,1396,1409,1418,1427,1442,1456,1461,1466],{"__ignoreMap":615},[620,1397,1398,1400,1402,1405,1407],{"class":622,"line":623},[620,1399,764],{"class":626},[620,1401,767],{"class":626},[620,1403,1404],{"class":770}," defineNuxtConfig",[620,1406,774],{"class":634},[620,1408,925],{"class":630},[620,1410,1411,1414,1416],{"class":622,"line":735},[620,1412,1413],{"class":809},"  runtimeConfig",[620,1415,933],{"class":630},[620,1417,789],{"class":630},[620,1419,1420,1423,1425],{"class":622,"line":754},[620,1421,1422],{"class":809},"    posthog",[620,1424,933],{"class":630},[620,1426,789],{"class":630},[620,1428,1429,1432,1434,1437,1439],{"class":622,"line":761},[620,1430,1431],{"class":809},"      apiKey",[620,1433,933],{"class":630},[620,1435,1436],{"class":630}," ''",[620,1438,820],{"class":630},[620,1440,1441],{"class":731}," \u002F\u002F Set via POSTHOG_API_KEY\n",[620,1443,1444,1447,1449,1451,1453],{"class":622,"line":792},[620,1445,1446],{"class":809},"      host",[620,1448,933],{"class":630},[620,1450,1436],{"class":630},[620,1452,820],{"class":630},[620,1454,1455],{"class":731}," \u002F\u002F Set via POSTHOG_HOST\n",[620,1457,1458],{"class":622,"line":828},[620,1459,1460],{"class":630},"    },\n",[620,1462,1463],{"class":622,"line":946},[620,1464,1465],{"class":630},"  },\n",[620,1467,1468,1470],{"class":622,"line":961},[620,1469,831],{"class":630},[620,1471,834],{"class":634},[656,1473,1475],{"id":1474},"override-options","Override Options",[541,1477,1478],{},"Pass options directly to override any configuration:",[609,1480,1483],{"className":611,"code":1481,"filename":1482,"language":614,"meta":615,"style":615},"const drain = createPostHogDrain({\n  host: 'https:\u002F\u002Feu.i.posthog.com',\n  timeout: 10000,\n})\n","server\u002Fplugins\u002Fevlog-drain.ts",[617,1484,1485,1501,1517,1530],{"__ignoreMap":615},[620,1486,1487,1490,1493,1495,1497,1499],{"class":622,"line":623},[620,1488,1489],{"class":785},"const",[620,1491,1492],{"class":634}," drain ",[620,1494,710],{"class":630},[620,1496,635],{"class":770},[620,1498,774],{"class":634},[620,1500,925],{"class":630},[620,1502,1503,1506,1508,1510,1513,1515],{"class":622,"line":735},[620,1504,1505],{"class":809},"  host",[620,1507,933],{"class":630},[620,1509,644],{"class":630},[620,1511,1512],{"class":647},"https:\u002F\u002Feu.i.posthog.com",[620,1514,812],{"class":630},[620,1516,943],{"class":630},[620,1518,1519,1522,1524,1528],{"class":622,"line":754},[620,1520,1521],{"class":809},"  timeout",[620,1523,933],{"class":630},[620,1525,1527],{"class":1526},"sbssI"," 10000",[620,1529,943],{"class":630},[620,1531,1532,1534],{"class":622,"line":761},[620,1533,831],{"class":630},[620,1535,834],{"class":634},[656,1537,1539],{"id":1538},"full-configuration-reference","Full Configuration Reference",[1340,1541,1542,1557],{},[1343,1543,1544],{},[1346,1545,1546,1549,1552,1555],{},[1349,1547,1548],{},"Option",[1349,1550,1551],{},"Type",[1349,1553,1554],{},"Default",[1349,1556,1354],{},[1356,1558,1559,1577,1596,1612,1631,1650,1674,1694],{},[1346,1560,1561,1566,1571,1574],{},[1361,1562,1563],{},[617,1564,1565],{},"apiKey",[1361,1567,1568],{},[617,1569,1570],{},"string",[1361,1572,1573],{},"-",[1361,1575,1576],{},"Project API key (required)",[1346,1578,1579,1584,1588,1593],{},[1361,1580,1581],{},[617,1582,1583],{},"host",[1361,1585,1586],{},[617,1587,1570],{},[1361,1589,1590],{},[617,1591,1592],{},"https:\u002F\u002Fus.i.posthog.com",[1361,1594,1595],{},"PostHog host URL",[1346,1597,1598,1603,1607,1609],{},[1361,1599,1600],{},[617,1601,1602],{},"distinctId",[1361,1604,1605],{},[617,1606,1570],{},[1361,1608,1573],{},[1361,1610,1611],{},"Static person identifier for every event",[1346,1613,1614,1619,1623,1628],{},[1361,1615,1616],{},[617,1617,1618],{},"distinctIdField",[1361,1620,1621],{},[617,1622,1570],{},[1361,1624,1625],{},[617,1626,1627],{},"userId",[1361,1629,1630],{},"Event field holding the person identifier (dot path)",[1346,1632,1633,1638,1642,1647],{},[1361,1634,1635],{},[617,1636,1637],{},"sessionIdField",[1361,1639,1640],{},[617,1641,1570],{},[1361,1643,1644],{},[617,1645,1646],{},"sessionId",[1361,1648,1649],{},"Event field holding the PostHog session id (dot path)",[1346,1651,1652,1657,1662,1667],{},[1361,1653,1654],{},[617,1655,1656],{},"recordShape",[1361,1658,1659],{},[617,1660,1661],{},"'json' | 'compact'",[1361,1663,1664],{},[617,1665,1666],{},"'json'",[1361,1668,1669,1670],{},"Log record shape — see ",[544,1671,1673],{"href":1672},"#choosing-a-record-shape","below",[1346,1675,1676,1681,1686,1691],{},[1361,1677,1678],{},[617,1679,1680],{},"timeout",[1361,1682,1683],{},[617,1684,1685],{},"number",[1361,1687,1688],{},[617,1689,1690],{},"5000",[1361,1692,1693],{},"Request timeout in milliseconds",[1346,1695,1696,1701,1705,1710],{},[1361,1697,1698],{},[617,1699,1700],{},"retries",[1361,1702,1703],{},[617,1704,1685],{},[1361,1706,1707],{},[617,1708,1709],{},"2",[1361,1711,1712],{},"Retry attempts on transient failures",[602,1714,1716],{"id":1715},"how-it-works","How It Works",[541,1718,1719,1720,1722,1723,1726],{},"Under the hood, ",[617,1721,1315],{}," wraps the OTLP adapter's ",[617,1724,1725],{},"sendBatchToOTLP()"," with PostHog-specific defaults:",[1728,1729,1730,1740,1749,1759],"ul",{},[568,1731,1732,1735,1736,1739],{},[674,1733,1734],{},"Endpoint",": ",[617,1737,1738],{},"{host}\u002Fi\u002Fv1\u002Flogs"," (PostHog's OTLP log ingest endpoint)",[568,1741,1742,1735,1745,1748],{},[674,1743,1744],{},"Auth",[617,1746,1747],{},"Authorization: Bearer {apiKey}"," header",[568,1750,1751,1754,1755,1758],{},[674,1752,1753],{},"Format",": Standard OTLP ",[617,1756,1757],{},"ExportLogsServiceRequest"," with severity levels, trace context, and structured attributes",[568,1760,1761,1735,1764,1767,1768,1770],{},[674,1762,1763],{},"Identity",[617,1765,1766],{},"posthogDistinctId"," and ",[617,1769,1646],{}," attributes, which is how PostHog joins a log to the rest of your project data",[602,1772,1774],{"id":1773},"choosing-a-record-shape","Choosing a Record Shape",[541,1776,1777,1778,1781,1782,1785,1786,1789],{},"PostHog treats log attributes as facets: you filter, break down, and alert on them. With the default ",[617,1779,1780],{},"json"," shape a nested field arrives as one serialized attribute — ",[617,1783,1784],{},"ai"," = ",[617,1787,1788],{},"{\"calls\":2,\"costUsd\":0.0012}"," — which PostHog can display but not chart.",[541,1791,1792,1795,1796,1767,1799,1802],{},[617,1793,1794],{},"compact"," flattens those into ",[617,1797,1798],{},"ai.calls",[617,1800,1801],{},"ai.costUsd",", and replaces the body with a one-line summary instead of repeating the whole event:",[609,1804,1806],{"className":611,"code":1805,"filename":1482,"language":614,"meta":615,"style":615},"const drain = createPostHogDrain({ recordShape: 'compact' })\n",[617,1807,1808],{"__ignoreMap":615},[620,1809,1810,1812,1814,1816,1818,1820,1822,1825,1827,1829,1831,1833,1835],{"class":622,"line":623},[620,1811,1489],{"class":785},[620,1813,1492],{"class":634},[620,1815,710],{"class":630},[620,1817,635],{"class":770},[620,1819,774],{"class":634},[620,1821,1012],{"class":630},[620,1823,1824],{"class":809}," recordShape",[620,1826,933],{"class":630},[620,1828,644],{"class":630},[620,1830,1794],{"class":647},[620,1832,812],{"class":630},[620,1834,638],{"class":630},[620,1836,834],{"class":634},[541,1838,1839],{},"This is the recommended shape for PostHog. It also cuts what you send: Logs is billed per GB ingested, and the default shape transmits every field twice — once in the body, once in the attributes.",[1841,1842,1844,1846,1847,1849],"callout",{"color":1843,"icon":13},"info",[617,1845,1794],{}," becomes the default in the next major. Set it on a new project now; switching later means rewriting the saved views and alerts built on the ",[617,1848,1780],{}," shape.",[602,1851,1853],{"id":1852},"linking-logs-to-people-and-session-replays","Linking Logs to People and Session Replays",[541,1855,1856,1857,1860],{},"A log that carries a person identifier shows up on that person's profile in PostHog, under the ",[674,1858,1859],{},"Logs"," tab — no service-name guessing to find what a specific user hit. Carry a session id too and the log links to their session replay.",[541,1862,1863,1864,1866,1867,1869],{},"PostHog reads both from log attributes: ",[617,1865,1766],{}," for the person, ",[617,1868,1646],{}," for the replay. The adapter fills them from your wide event, so this works as soon as your event carries the values:",[609,1871,1874],{"className":611,"code":1872,"filename":1873,"language":614,"meta":615,"style":615},"const log = useLogger(event)\n\nlog.set({\n  userId: user.id, \u002F\u002F → posthogDistinctId, links to the person\n  sessionId: body.sessionId, \u002F\u002F → sessionId, links to the session replay\n})\n","server\u002Fapi\u002Fcheckout.post.ts",[617,1875,1876,1890,1894,1908,1928,1947],{"__ignoreMap":615},[620,1877,1878,1880,1883,1885,1887],{"class":622,"line":623},[620,1879,1489],{"class":785},[620,1881,1882],{"class":634}," log ",[620,1884,710],{"class":630},[620,1886,903],{"class":770},[620,1888,1889],{"class":634},"(event)\n",[620,1891,1892],{"class":622,"line":735},[620,1893,758],{"emptyLinePlaceholder":757},[620,1895,1896,1899,1901,1904,1906],{"class":622,"line":754},[620,1897,1898],{"class":634},"log",[620,1900,798],{"class":630},[620,1902,1903],{"class":770},"set",[620,1905,774],{"class":634},[620,1907,925],{"class":630},[620,1909,1910,1913,1915,1918,1920,1923,1925],{"class":622,"line":761},[620,1911,1912],{"class":809},"  userId",[620,1914,933],{"class":630},[620,1916,1917],{"class":634}," user",[620,1919,798],{"class":630},[620,1921,1922],{"class":634},"id",[620,1924,820],{"class":630},[620,1926,1927],{"class":731}," \u002F\u002F → posthogDistinctId, links to the person\n",[620,1929,1930,1933,1935,1938,1940,1942,1944],{"class":622,"line":792},[620,1931,1932],{"class":809},"  sessionId",[620,1934,933],{"class":630},[620,1936,1937],{"class":634}," body",[620,1939,798],{"class":630},[620,1941,1646],{"class":634},[620,1943,820],{"class":630},[620,1945,1946],{"class":731}," \u002F\u002F → sessionId, links to the session replay\n",[620,1948,1949,1951],{"class":622,"line":828},[620,1950,831],{"class":630},[620,1952,834],{"class":634},[541,1954,1955,1956,1959],{},"The session id comes from the frontend — read it with ",[617,1957,1958],{},"posthog.get_session_id()"," and send it along with the request:",[609,1961,1964],{"className":611,"code":1962,"filename":1963,"language":614,"meta":615,"style":615},"import posthog from 'posthog-js'\n\nawait $fetch('\u002Fapi\u002Fcheckout', {\n  method: 'POST',\n  body: { ...payload, sessionId: posthog.get_session_id() },\n})\n","app\u002Fcheckout.ts",[617,1965,1966,1983,1987,2007,2023,2058],{"__ignoreMap":615},[620,1967,1968,1970,1973,1976,1978,1981],{"class":622,"line":623},[620,1969,627],{"class":626},[620,1971,1972],{"class":634}," posthog ",[620,1974,1975],{"class":626},"from",[620,1977,644],{"class":630},[620,1979,1980],{"class":647},"posthog-js",[620,1982,651],{"class":630},[620,1984,1985],{"class":622,"line":735},[620,1986,758],{"emptyLinePlaceholder":757},[620,1988,1989,1991,1994,1996,1998,2001,2003,2005],{"class":622,"line":754},[620,1990,1113],{"class":626},[620,1992,1993],{"class":770}," $fetch",[620,1995,774],{"class":634},[620,1997,812],{"class":630},[620,1999,2000],{"class":647},"\u002Fapi\u002Fcheckout",[620,2002,812],{"class":630},[620,2004,820],{"class":630},[620,2006,789],{"class":630},[620,2008,2009,2012,2014,2016,2019,2021],{"class":622,"line":761},[620,2010,2011],{"class":809},"  method",[620,2013,933],{"class":630},[620,2015,644],{"class":630},[620,2017,2018],{"class":647},"POST",[620,2020,812],{"class":630},[620,2022,943],{"class":630},[620,2024,2025,2028,2030,2032,2035,2038,2040,2043,2045,2048,2050,2053,2055],{"class":622,"line":792},[620,2026,2027],{"class":809},"  body",[620,2029,933],{"class":630},[620,2031,631],{"class":630},[620,2033,2034],{"class":630}," ...",[620,2036,2037],{"class":634},"payload",[620,2039,820],{"class":630},[620,2041,2042],{"class":809}," sessionId",[620,2044,933],{"class":630},[620,2046,2047],{"class":634}," posthog",[620,2049,798],{"class":630},[620,2051,2052],{"class":770},"get_session_id",[620,2054,1022],{"class":634},[620,2056,2057],{"class":630},"},\n",[620,2059,2060,2062],{"class":622,"line":828},[620,2061,831],{"class":630},[620,2063,834],{"class":634},[656,2065,2067],{"id":2066},"pointing-at-your-own-fields","Pointing at Your Own Fields",[541,2069,2070],{},"When identity lives somewhere else on your events, point the adapter at it. Both options take a dot path:",[609,2072,2074],{"className":611,"code":2073,"filename":1482,"language":614,"meta":615,"style":615},"const drain = createPostHogDrain({\n  distinctIdField: 'user.id',\n  sessionIdField: 'session.id',\n})\n",[617,2075,2076,2090,2106,2122],{"__ignoreMap":615},[620,2077,2078,2080,2082,2084,2086,2088],{"class":622,"line":623},[620,2079,1489],{"class":785},[620,2081,1492],{"class":634},[620,2083,710],{"class":630},[620,2085,635],{"class":770},[620,2087,774],{"class":634},[620,2089,925],{"class":630},[620,2091,2092,2095,2097,2099,2102,2104],{"class":622,"line":735},[620,2093,2094],{"class":809},"  distinctIdField",[620,2096,933],{"class":630},[620,2098,644],{"class":630},[620,2100,2101],{"class":647},"user.id",[620,2103,812],{"class":630},[620,2105,943],{"class":630},[620,2107,2108,2111,2113,2115,2118,2120],{"class":622,"line":754},[620,2109,2110],{"class":809},"  sessionIdField",[620,2112,933],{"class":630},[620,2114,644],{"class":630},[620,2116,2117],{"class":647},"session.id",[620,2119,812],{"class":630},[620,2121,943],{"class":630},[620,2123,2124,2126],{"class":622,"line":761},[620,2125,831],{"class":630},[620,2127,834],{"class":634},[541,2129,2130,2131,2134],{},"For an ",[544,2132,2133],{"href":437},"eve agent",", the caller principal is the identity eve itself routes on:",[609,2136,2139],{"className":611,"code":2137,"filename":2138,"language":614,"meta":615,"style":615},"const drain = createPostHogDrain({ distinctIdField: 'eve.caller.principalId' })\n","agent\u002Fhooks\u002Fevlog.ts",[617,2140,2141],{"__ignoreMap":615},[620,2142,2143,2145,2147,2149,2151,2153,2155,2158,2160,2162,2165,2167,2169],{"class":622,"line":623},[620,2144,1489],{"class":785},[620,2146,1492],{"class":634},[620,2148,710],{"class":630},[620,2150,635],{"class":770},[620,2152,774],{"class":634},[620,2154,1012],{"class":630},[620,2156,2157],{"class":809}," distinctIdField",[620,2159,933],{"class":630},[620,2161,644],{"class":630},[620,2163,2164],{"class":647},"eve.caller.principalId",[620,2166,812],{"class":630},[620,2168,638],{"class":630},[620,2170,834],{"class":634},[541,2172,2173,2174,2176],{},"A static ",[617,2175,1602],{}," overrides the field lookup entirely — use it for a backend that acts as one identity rather than on behalf of users.",[1841,2178,2179,2180,2183,2184,677,2186,2188,2189,2191],{"color":1843,"icon":13},"PostHog matches the attribute value against every ",[617,2181,2182],{},"distinct_id"," it knows for a person, so any one of their identifiers works. The attribute key is configurable per project under ",[674,2185,676],{},[674,2187,1859],{}," — leave it at the default ",[617,2190,1766],{}," and this works out of the box.",[602,2193,2195],{"id":2194},"regions","Regions",[541,2197,2198,2199,2201],{},"PostHog offers US and EU cloud hosting. Set the ",[617,2200,1583],{}," to match your region:",[1340,2203,2204,2214],{},[1343,2205,2206],{},[1346,2207,2208,2211],{},[1349,2209,2210],{},"Region",[1349,2212,2213],{},"Host",[1356,2215,2216,2225,2234],{},[1346,2217,2218,2221],{},[1361,2219,2220],{},"US (default)",[1361,2222,2223],{},[617,2224,1592],{},[1346,2226,2227,2230],{},[1361,2228,2229],{},"EU",[1361,2231,2232],{},[617,2233,1512],{},[1346,2235,2236,2239],{},[1361,2237,2238],{},"Self-hosted",[1361,2240,2241],{},"Your instance URL",[609,2243,2245],{"className":697,"code":2244,"filename":699,"language":700,"meta":615,"style":615},"# EU region\nPOSTHOG_API_KEY=phc_xxx\nPOSTHOG_HOST=https:\u002F\u002Feu.i.posthog.com\n",[617,2246,2247,2252,2261],{"__ignoreMap":615},[620,2248,2249],{"class":622,"line":623},[620,2250,2251],{"class":731},"# EU region\n",[620,2253,2254,2256,2258],{"class":622,"line":735},[620,2255,707],{"class":634},[620,2257,710],{"class":630},[620,2259,2260],{"class":647},"phc_xxx\n",[620,2262,2263,2265,2267],{"class":622,"line":754},[620,2264,1376],{"class":634},[620,2266,710],{"class":630},[620,2268,2269],{"class":647},"https:\u002F\u002Feu.i.posthog.com\n",[602,2271,2273],{"id":2272},"querying-logs-in-posthog","Querying Logs in PostHog",[541,2275,2276,2277,2279],{},"Once your logs are flowing, use the ",[674,2278,1859],{}," tab in PostHog to query them:",[565,2281,2282,2287,2290],{},[568,2283,672,2284,2286],{},[674,2285,1859],{}," and filter by service, severity, or any structured attribute",[568,2288,2289],{},"Use the search bar to find specific log entries",[568,2291,2292],{},"Click on a log entry to see all structured attributes",[602,2294,2296],{"id":2295},"posthog-events-custom-events","PostHog Events (Custom Events)",[541,2298,2299,2300,2302,2303,933],{},"If you prefer sending logs as PostHog custom events (e.g., for product analytics, cohorts, or funnels), use ",[617,2301,1315],{}," with ",[617,2304,2305],{},"mode: 'events'",[609,2307,2309],{"className":611,"code":2308,"filename":1482,"language":614,"meta":615,"style":615},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\nconst drain = createPostHogDrain({\n  mode: 'events',\n  eventName: 'server_request',\n  distinctId: 'my-backend-service',\n})\n",[617,2310,2311,2329,2333,2347,2363,2379,2395],{"__ignoreMap":615},[620,2312,2313,2315,2317,2319,2321,2323,2325,2327],{"class":622,"line":623},[620,2314,627],{"class":626},[620,2316,631],{"class":630},[620,2318,635],{"class":634},[620,2320,638],{"class":630},[620,2322,641],{"class":626},[620,2324,644],{"class":630},[620,2326,648],{"class":647},[620,2328,651],{"class":630},[620,2330,2331],{"class":622,"line":735},[620,2332,758],{"emptyLinePlaceholder":757},[620,2334,2335,2337,2339,2341,2343,2345],{"class":622,"line":754},[620,2336,1489],{"class":785},[620,2338,1492],{"class":634},[620,2340,710],{"class":630},[620,2342,635],{"class":770},[620,2344,774],{"class":634},[620,2346,925],{"class":630},[620,2348,2349,2352,2354,2356,2359,2361],{"class":622,"line":761},[620,2350,2351],{"class":809},"  mode",[620,2353,933],{"class":630},[620,2355,644],{"class":630},[620,2357,2358],{"class":647},"events",[620,2360,812],{"class":630},[620,2362,943],{"class":630},[620,2364,2365,2368,2370,2372,2375,2377],{"class":622,"line":792},[620,2366,2367],{"class":809},"  eventName",[620,2369,933],{"class":630},[620,2371,644],{"class":630},[620,2373,2374],{"class":647},"server_request",[620,2376,812],{"class":630},[620,2378,943],{"class":630},[620,2380,2381,2384,2386,2388,2391,2393],{"class":622,"line":828},[620,2382,2383],{"class":809},"  distinctId",[620,2385,933],{"class":630},[620,2387,644],{"class":630},[620,2389,2390],{"class":647},"my-backend-service",[620,2392,812],{"class":630},[620,2394,943],{"class":630},[620,2396,2397,2399],{"class":622,"line":946},[620,2398,831],{"class":630},[620,2400,834],{"class":634},[541,2402,2403,2404,2407,2408,2411],{},"Then pass ",[617,2405,2406],{},"drain"," to your framework the same way as the default logs drain (see ",[544,2409,25],{"href":2410},"#quick-start"," above).",[1841,2413,2414,2415,2417],{"color":1843,"icon":13},"Custom events count towards your PostHog event quota. PostHog Logs (the default ",[617,2416,1315],{},") is significantly cheaper.",[1841,2419,2422,2425,2426,2429,2430,2433],{"color":2420,"icon":2421},"warning","i-lucide-triangle-alert",[674,2423,2424],{},"Legacy:"," ",[617,2427,2428],{},"createPostHogEventsDrain()"," is deprecated and re-routes to ",[617,2431,2432],{},"createPostHogDrain({ mode: 'events' })",". It will be removed in the next major release.",[656,2435,2437],{"id":2436},"events-configuration","Events Configuration",[1340,2439,2440,2452],{},[1343,2441,2442],{},[1346,2443,2444,2446,2448,2450],{},[1349,2445,1548],{},[1349,2447,1551],{},[1349,2449,1554],{},[1349,2451,1354],{},[1356,2453,2454,2468,2484,2503,2521,2541],{},[1346,2455,2456,2460,2464,2466],{},[1361,2457,2458],{},[617,2459,1565],{},[1361,2461,2462],{},[617,2463,1570],{},[1361,2465,1573],{},[1361,2467,1576],{},[1346,2469,2470,2474,2478,2482],{},[1361,2471,2472],{},[617,2473,1583],{},[1361,2475,2476],{},[617,2477,1570],{},[1361,2479,2480],{},[617,2481,1592],{},[1361,2483,1595],{},[1346,2485,2486,2491,2495,2500],{},[1361,2487,2488],{},[617,2489,2490],{},"eventName",[1361,2492,2493],{},[617,2494,1570],{},[1361,2496,2497],{},[617,2498,2499],{},"evlog_wide_event",[1361,2501,2502],{},"PostHog event name",[1346,2504,2505,2509,2513,2515],{},[1361,2506,2507],{},[617,2508,1602],{},[1361,2510,2511],{},[617,2512,1570],{},[1361,2514,1573],{},[1361,2516,2517,2518,2520],{},"Static ",[617,2519,2182],{}," for all events",[1346,2522,2523,2527,2531,2535],{},[1361,2524,2525],{},[617,2526,1618],{},[1361,2528,2529],{},[617,2530,1570],{},[1361,2532,2533],{},[617,2534,1627],{},[1361,2536,2537,2538,2540],{},"Event field holding the ",[617,2539,2182],{}," (dot path)",[1346,2542,2543,2547,2551,2555],{},[1361,2544,2545],{},[617,2546,1680],{},[1361,2548,2549],{},[617,2550,1685],{},[1361,2552,2553],{},[617,2554,1690],{},[1361,2556,1693],{},[656,2558,2560],{"id":2559},"event-format","Event Format",[541,2562,2563],{},"evlog maps wide events to PostHog events:",[1340,2565,2566,2576],{},[1343,2567,2568],{},[1346,2569,2570,2573],{},[1349,2571,2572],{},"evlog Field",[1349,2574,2575],{},"PostHog Field",[1356,2577,2578,2596,2607,2619,2630,2642],{},[1346,2579,2580,2591],{},[1361,2581,2582,2585,2586,2585,2588],{},[617,2583,2584],{},"config.distinctId"," or ",[617,2587,1627],{},[617,2589,2590],{},"service",[1361,2592,2593,2595],{},[617,2594,2182],{}," (fallback chain)",[1346,2597,2598,2603],{},[1361,2599,2600],{},[617,2601,2602],{},"timestamp",[1361,2604,2605],{},[617,2606,2602],{},[1346,2608,2609,2614],{},[1361,2610,2611],{},[617,2612,2613],{},"level",[1361,2615,2616],{},[617,2617,2618],{},"properties.level",[1346,2620,2621,2625],{},[1361,2622,2623],{},[617,2624,2590],{},[1361,2626,2627],{},[617,2628,2629],{},"properties.service",[1346,2631,2632,2637],{},[1361,2633,2634],{},[617,2635,2636],{},"environment",[1361,2638,2639],{},[617,2640,2641],{},"properties.environment",[1346,2643,2644,2647],{},[1361,2645,2646],{},"All other fields",[1361,2648,2649],{},[617,2650,2651],{},"properties.*",[656,2653,2655],{"id":2654},"distinct-id-resolution","Distinct ID Resolution",[541,2657,2658,2659,2661],{},"The ",[617,2660,2182],{}," follows a fallback chain:",[565,2663,2664,2673,2684],{},[568,2665,2666,2670,2671],{},[674,2667,2668],{},[617,2669,2584],{}," - explicit override in ",[617,2672,2432],{},[568,2674,2675,2680,2681,2683],{},[674,2676,2677],{},[617,2678,2679],{},"event.userId"," - or whatever ",[617,2682,1618],{}," points at, when it holds a string or a number",[568,2685,2686,2691],{},[674,2687,2688],{},[617,2689,2690],{},"event.service"," - final fallback, sent as an anonymous event",[656,2693,2695],{"id":2694},"identified-vs-anonymous-events","Identified vs Anonymous Events",[541,2697,2698,2699,2702],{},"An event that resolves to a real person is an ",[674,2700,2701],{},"identified"," event: PostHog creates a person profile for it and attaches person properties.",[541,2704,2705,2706,2709,2710,2713],{},"When no identifier resolves, the event is sent as ",[674,2707,2708],{},"anonymous"," — ",[617,2711,2712],{},"$process_person_profile: false"," — rather than piling every request onto one \"person\" named after your service. PostHog bills anonymous events at a lower rate and keeps them out of person profiles.",[609,2715,2717],{"className":611,"code":2716,"filename":1482,"language":614,"meta":615,"style":615},"\u002F\u002F Identified: events carrying `userId` create and update a person profile\nconst drain = createPostHogDrain({ mode: 'events' })\n\n\u002F\u002F Identified as one backend identity, whatever the request\nconst service = createPostHogDrain({ mode: 'events', distinctId: 'checkout-worker' })\n",[617,2718,2719,2724,2753,2757,2762],{"__ignoreMap":615},[620,2720,2721],{"class":622,"line":623},[620,2722,2723],{"class":731},"\u002F\u002F Identified: events carrying `userId` create and update a person profile\n",[620,2725,2726,2728,2730,2732,2734,2736,2738,2741,2743,2745,2747,2749,2751],{"class":622,"line":735},[620,2727,1489],{"class":785},[620,2729,1492],{"class":634},[620,2731,710],{"class":630},[620,2733,635],{"class":770},[620,2735,774],{"class":634},[620,2737,1012],{"class":630},[620,2739,2740],{"class":809}," mode",[620,2742,933],{"class":630},[620,2744,644],{"class":630},[620,2746,2358],{"class":647},[620,2748,812],{"class":630},[620,2750,638],{"class":630},[620,2752,834],{"class":634},[620,2754,2755],{"class":622,"line":754},[620,2756,758],{"emptyLinePlaceholder":757},[620,2758,2759],{"class":622,"line":761},[620,2760,2761],{"class":731},"\u002F\u002F Identified as one backend identity, whatever the request\n",[620,2763,2764,2766,2769,2771,2773,2775,2777,2779,2781,2783,2785,2787,2789,2792,2794,2796,2799,2801,2803],{"class":622,"line":792},[620,2765,1489],{"class":785},[620,2767,2768],{"class":634}," service ",[620,2770,710],{"class":630},[620,2772,635],{"class":770},[620,2774,774],{"class":634},[620,2776,1012],{"class":630},[620,2778,2740],{"class":809},[620,2780,933],{"class":630},[620,2782,644],{"class":630},[620,2784,2358],{"class":647},[620,2786,812],{"class":630},[620,2788,820],{"class":630},[620,2790,2791],{"class":809}," distinctId",[620,2793,933],{"class":630},[620,2795,644],{"class":630},[620,2797,2798],{"class":647},"checkout-worker",[620,2800,812],{"class":630},[620,2802,638],{"class":630},[620,2804,834],{"class":634},[1841,2806,2807],{"color":1843,"icon":13},"Anonymous events can be up to 4× cheaper than identified ones. Only set an identity on the events where you actually need per-person analysis.",[656,2809,2811],{"id":2810},"logs-vs-events","Logs vs Events",[1340,2813,2814,2828],{},[1343,2815,2816],{},[1346,2817,2818,2820,2824],{},[1349,2819],{},[1349,2821,2822],{},[617,2823,1315],{},[1349,2825,2826],{},[617,2827,2432],{},[1356,2829,2830,2848,2861,2873],{},[1346,2831,2832,2836,2842],{},[1361,2833,2834],{},[674,2835,1753],{},[1361,2837,2838,2839,690],{},"OTLP Logs (",[617,2840,2841],{},"\u002Fi\u002Fv1\u002Flogs",[1361,2843,2844,2845,690],{},"PostHog Events (",[617,2846,2847],{},"\u002Fbatch\u002F",[1346,2849,2850,2855,2858],{},[1361,2851,2852],{},[674,2853,2854],{},"PostHog UI",[1361,2856,2857],{},"Logs viewer",[1361,2859,2860],{},"Events explorer",[1346,2862,2863,2867,2870],{},[1361,2864,2865],{},[674,2866,530],{},[1361,2868,2869],{},"Lower (dedicated logs pipeline)",[1361,2871,2872],{},"Higher (counts as events)",[1346,2874,2875,2880,2883],{},[1361,2876,2877],{},[674,2878,2879],{},"Best for",[1361,2881,2882],{},"Debugging, log search, observability",[1361,2884,2885],{},"Product analytics, cohorts, funnels",[541,2887,2888],{},"You can use both drains simultaneously to get the best of both worlds:",[609,2890,2892],{"className":611,"code":2891,"filename":1482,"language":614,"meta":615,"style":615},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\nconst logs = createPostHogDrain()\nconst events = createPostHogDrain({ mode: 'events' })\n\nconst drain = async (ctx) => {\n  await Promise.allSettled([logs(ctx), events(ctx)])\n}\n",[617,2893,2894,2912,2916,2930,2959,2963,2985,3023],{"__ignoreMap":615},[620,2895,2896,2898,2900,2902,2904,2906,2908,2910],{"class":622,"line":623},[620,2897,627],{"class":626},[620,2899,631],{"class":630},[620,2901,635],{"class":634},[620,2903,638],{"class":630},[620,2905,641],{"class":626},[620,2907,644],{"class":630},[620,2909,648],{"class":647},[620,2911,651],{"class":630},[620,2913,2914],{"class":622,"line":735},[620,2915,758],{"emptyLinePlaceholder":757},[620,2917,2918,2920,2923,2925,2927],{"class":622,"line":754},[620,2919,1489],{"class":785},[620,2921,2922],{"class":634}," logs ",[620,2924,710],{"class":630},[620,2926,635],{"class":770},[620,2928,2929],{"class":634},"()\n",[620,2931,2932,2934,2937,2939,2941,2943,2945,2947,2949,2951,2953,2955,2957],{"class":622,"line":761},[620,2933,1489],{"class":785},[620,2935,2936],{"class":634}," events ",[620,2938,710],{"class":630},[620,2940,635],{"class":770},[620,2942,774],{"class":634},[620,2944,1012],{"class":630},[620,2946,2740],{"class":809},[620,2948,933],{"class":630},[620,2950,644],{"class":630},[620,2952,2358],{"class":647},[620,2954,812],{"class":630},[620,2956,638],{"class":630},[620,2958,834],{"class":634},[620,2960,2961],{"class":622,"line":792},[620,2962,758],{"emptyLinePlaceholder":757},[620,2964,2965,2967,2969,2971,2974,2976,2979,2981,2983],{"class":622,"line":828},[620,2966,1489],{"class":785},[620,2968,1492],{"class":634},[620,2970,710],{"class":630},[620,2972,2973],{"class":785}," async",[620,2975,1331],{"class":630},[620,2977,2978],{"class":779},"ctx",[620,2980,690],{"class":630},[620,2982,786],{"class":785},[620,2984,789],{"class":630},[620,2986,2987,2990,2994,2996,2999,3002,3005,3007,3009,3011,3013,3016,3018,3020],{"class":622,"line":946},[620,2988,2989],{"class":626},"  await",[620,2991,2993],{"class":2992},"sBMFI"," Promise",[620,2995,798],{"class":630},[620,2997,2998],{"class":770},"allSettled",[620,3000,3001],{"class":809},"([",[620,3003,3004],{"class":770},"logs",[620,3006,774],{"class":809},[620,3008,2978],{"class":634},[620,3010,690],{"class":809},[620,3012,820],{"class":630},[620,3014,3015],{"class":770}," events",[620,3017,774],{"class":809},[620,3019,2978],{"class":634},[620,3021,3022],{"class":809},")])\n",[620,3024,3025],{"class":622,"line":961},[620,3026,3027],{"class":630},"}\n",[602,3029,3031],{"id":3030},"troubleshooting","Troubleshooting",[656,3033,3035],{"id":3034},"missing-apikey-error","Missing apiKey error",[609,3037,3043],{"className":3038,"code":3040,"filename":3041,"language":3042,"meta":615},[3039],"language-text","[evlog\u002Fposthog] Missing apiKey. Set POSTHOG_API_KEY env var or pass to createPostHogDrain()\n","Console","text",[617,3044,3040],{"__ignoreMap":615},[541,3046,3047],{},"Make sure your environment variable is set and the server was restarted after adding it.",[656,3049,3051],{"id":3050},"events-not-appearing","Events not appearing",[541,3053,3054],{},"PostHog processes events asynchronously. There may be a short delay (typically under 1 minute) before events appear in the dashboard.",[565,3056,3057,3064,3069],{},[568,3058,3059,3060,3063],{},"Check the server console for ",[617,3061,3062],{},"[evlog\u002Fposthog]"," error messages",[568,3065,3066,3067],{},"Verify your API key is correct and starts with ",[617,3068,689],{},[568,3070,3071,3072,3074],{},"Confirm your ",[617,3073,1583],{}," matches your PostHog region (US vs EU)",[656,3076,3078],{"id":3077},"wrong-region","Wrong region",[541,3080,3081,3082,3084],{},"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 ",[617,3083,3062],{},") to your server console. Set the correct host:",[609,3086,3088],{"className":697,"code":3087,"filename":699,"language":700,"meta":615,"style":615},"POSTHOG_HOST=https:\u002F\u002Feu.i.posthog.com\n",[617,3089,3090],{"__ignoreMap":615},[620,3091,3092,3094,3096],{"class":622,"line":623},[620,3093,1376],{"class":634},[620,3095,710],{"class":630},[620,3097,2269],{"class":647},[602,3099,3101],{"id":3100},"direct-api-usage","Direct API Usage",[541,3103,3104],{},"For advanced use cases, you can use the lower-level functions:",[609,3106,3109],{"className":611,"code":3107,"filename":3108,"language":614,"meta":615,"style":615},"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",[617,3110,3111,3135,3139,3144,3157,3173,3179,3183,3188,3202,3217],{"__ignoreMap":615},[620,3112,3113,3115,3117,3120,3122,3125,3127,3129,3131,3133],{"class":622,"line":623},[620,3114,627],{"class":626},[620,3116,631],{"class":630},[620,3118,3119],{"class":634}," sendToPostHog",[620,3121,820],{"class":630},[620,3123,3124],{"class":634}," sendBatchToPostHog",[620,3126,638],{"class":630},[620,3128,641],{"class":626},[620,3130,644],{"class":630},[620,3132,648],{"class":647},[620,3134,651],{"class":630},[620,3136,3137],{"class":622,"line":735},[620,3138,758],{"emptyLinePlaceholder":757},[620,3140,3141],{"class":622,"line":754},[620,3142,3143],{"class":731},"\u002F\u002F Send a single event to PostHog Logs (OTLP)\n",[620,3145,3146,3148,3150,3153,3155],{"class":622,"line":761},[620,3147,1113],{"class":626},[620,3149,3119],{"class":770},[620,3151,3152],{"class":634},"(event",[620,3154,820],{"class":630},[620,3156,789],{"class":630},[620,3158,3159,3162,3164,3166,3169,3171],{"class":622,"line":792},[620,3160,3161],{"class":809},"  apiKey",[620,3163,933],{"class":630},[620,3165,644],{"class":630},[620,3167,3168],{"class":647},"phc_xxx",[620,3170,812],{"class":630},[620,3172,943],{"class":630},[620,3174,3175,3177],{"class":622,"line":828},[620,3176,831],{"class":630},[620,3178,834],{"class":634},[620,3180,3181],{"class":622,"line":946},[620,3182,758],{"emptyLinePlaceholder":757},[620,3184,3185],{"class":622,"line":961},[620,3186,3187],{"class":731},"\u002F\u002F Send multiple events in one request\n",[620,3189,3191,3193,3195,3198,3200],{"class":622,"line":3190},9,[620,3192,1113],{"class":626},[620,3194,3124],{"class":770},[620,3196,3197],{"class":634},"(events",[620,3199,820],{"class":630},[620,3201,789],{"class":630},[620,3203,3205,3207,3209,3211,3213,3215],{"class":622,"line":3204},10,[620,3206,3161],{"class":809},[620,3208,933],{"class":630},[620,3210,644],{"class":630},[620,3212,3168],{"class":647},[620,3214,812],{"class":630},[620,3216,943],{"class":630},[620,3218,3220,3222],{"class":622,"line":3219},11,[620,3221,831],{"class":630},[620,3223,834],{"class":634},[541,3225,3226],{},"For custom events, use the events-specific functions:",[609,3228,3230],{"className":611,"code":3229,"filename":3108,"language":614,"meta":615,"style":615},"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",[617,3231,3232,3261,3265,3270,3282,3296,3302,3306,3311,3323,3337,3343,3348,3354],{"__ignoreMap":615},[620,3233,3234,3236,3238,3241,3243,3246,3248,3251,3253,3255,3257,3259],{"class":622,"line":623},[620,3235,627],{"class":626},[620,3237,631],{"class":630},[620,3239,3240],{"class":634}," sendToPostHogEvents",[620,3242,820],{"class":630},[620,3244,3245],{"class":634}," sendBatchToPostHogEvents",[620,3247,820],{"class":630},[620,3249,3250],{"class":634}," toPostHogEvent",[620,3252,638],{"class":630},[620,3254,641],{"class":626},[620,3256,644],{"class":630},[620,3258,648],{"class":647},[620,3260,651],{"class":630},[620,3262,3263],{"class":622,"line":735},[620,3264,758],{"emptyLinePlaceholder":757},[620,3266,3267],{"class":622,"line":754},[620,3268,3269],{"class":731},"\u002F\u002F Send a single custom event\n",[620,3271,3272,3274,3276,3278,3280],{"class":622,"line":761},[620,3273,1113],{"class":626},[620,3275,3240],{"class":770},[620,3277,3152],{"class":634},[620,3279,820],{"class":630},[620,3281,789],{"class":630},[620,3283,3284,3286,3288,3290,3292,3294],{"class":622,"line":792},[620,3285,3161],{"class":809},[620,3287,933],{"class":630},[620,3289,644],{"class":630},[620,3291,3168],{"class":647},[620,3293,812],{"class":630},[620,3295,943],{"class":630},[620,3297,3298,3300],{"class":622,"line":828},[620,3299,831],{"class":630},[620,3301,834],{"class":634},[620,3303,3304],{"class":622,"line":946},[620,3305,758],{"emptyLinePlaceholder":757},[620,3307,3308],{"class":622,"line":961},[620,3309,3310],{"class":731},"\u002F\u002F Send multiple custom events in one request\n",[620,3312,3313,3315,3317,3319,3321],{"class":622,"line":3190},[620,3314,1113],{"class":626},[620,3316,3245],{"class":770},[620,3318,3197],{"class":634},[620,3320,820],{"class":630},[620,3322,789],{"class":630},[620,3324,3325,3327,3329,3331,3333,3335],{"class":622,"line":3204},[620,3326,3161],{"class":809},[620,3328,933],{"class":630},[620,3330,644],{"class":630},[620,3332,3168],{"class":647},[620,3334,812],{"class":630},[620,3336,943],{"class":630},[620,3338,3339,3341],{"class":622,"line":3219},[620,3340,831],{"class":630},[620,3342,834],{"class":634},[620,3344,3346],{"class":622,"line":3345},12,[620,3347,758],{"emptyLinePlaceholder":757},[620,3349,3351],{"class":622,"line":3350},13,[620,3352,3353],{"class":731},"\u002F\u002F Convert event to PostHog format (for inspection)\n",[620,3355,3357,3359,3362,3364,3366,3368,3370,3372,3375,3377,3379,3381,3383,3385],{"class":622,"line":3356},14,[620,3358,1489],{"class":785},[620,3360,3361],{"class":634}," posthogEvent ",[620,3363,710],{"class":630},[620,3365,3250],{"class":770},[620,3367,3152],{"class":634},[620,3369,820],{"class":630},[620,3371,631],{"class":630},[620,3373,3374],{"class":809}," apiKey",[620,3376,933],{"class":630},[620,3378,644],{"class":630},[620,3380,3168],{"class":647},[620,3382,812],{"class":630},[620,3384,638],{"class":630},[620,3386,834],{"class":634},[602,3388,3390],{"id":3389},"next-steps","Next Steps",[1728,3392,3393,3399,3405,3411],{},[568,3394,3395,3398],{},[544,3396,3397],{"href":152},"Axiom Adapter"," - Send logs to Axiom",[568,3400,3401,3404],{},[544,3402,3403],{"href":192},"OTLP Adapter"," - Send logs via OpenTelemetry Protocol",[568,3406,3407,3410],{},[544,3408,3409],{"href":491},"Custom Adapters"," - Build your own adapter",[568,3412,3413,3415],{},[544,3414,517],{"href":518}," - Security and production tips",[3417,3418,3419],"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":615,"searchDepth":735,"depth":735,"links":3421},[3422,3423,3428,3434,3435,3436,3439,3440,3441,3448,3453,3454],{"id":604,"depth":735,"text":20},{"id":654,"depth":735,"text":25,"children":3424},[3425,3426,3427],{"id":658,"depth":754,"text":659},{"id":693,"depth":754,"text":694},{"id":716,"depth":754,"text":717},{"id":1301,"depth":735,"text":504,"children":3429},[3430,3431,3432,3433],{"id":1337,"depth":754,"text":1338},{"id":1382,"depth":754,"text":1383},{"id":1474,"depth":754,"text":1475},{"id":1538,"depth":754,"text":1539},{"id":1715,"depth":735,"text":1716},{"id":1773,"depth":735,"text":1774},{"id":1852,"depth":735,"text":1853,"children":3437},[3438],{"id":2066,"depth":754,"text":2067},{"id":2194,"depth":735,"text":2195},{"id":2272,"depth":735,"text":2273},{"id":2295,"depth":735,"text":2296,"children":3442},[3443,3444,3445,3446,3447],{"id":2436,"depth":754,"text":2437},{"id":2559,"depth":754,"text":2560},{"id":2654,"depth":754,"text":2655},{"id":2694,"depth":754,"text":2695},{"id":2810,"depth":754,"text":2811},{"id":3030,"depth":735,"text":3031,"children":3449},[3450,3451,3452],{"id":3034,"depth":754,"text":3035},{"id":3050,"depth":754,"text":3051},{"id":3077,"depth":754,"text":3078},{"id":3100,"depth":735,"text":3101},{"id":3389,"depth":735,"text":3390},"Send wide events to PostHog Logs via OTLP for structured log querying, debugging, and observability in your PostHog dashboard.","md",[3458,3464],{"label":3459,"icon":3460,"to":667,"target":3461,"color":3462,"variant":3463},"PostHog Dashboard","i-lucide-external-link","_blank","neutral","subtle",{"label":3397,"icon":154,"to":152,"color":3462,"variant":3463},{},{"title":156,"icon":159},{"title":536,"description":3455},"5wCZBEy5craKcoF4a1hNoq-65Zyu9XKfbFZdlgLEN6o",[3470,3472],{"title":151,"path":152,"stem":153,"description":3471,"icon":154,"children":-1},"Send wide events to Axiom for powerful querying, dashboards, and alerting. Zero-config setup with environment variables and automatic batching.",{"title":161,"path":162,"stem":163,"description":3473,"icon":164,"children":-1},"Send structured logs to Sentry Logs for high-cardinality querying and debugging. Zero-config setup with environment variables.",1786743664792]