[{"data":1,"prerenderedAt":3368},["ShallowReactive",2],{"navigation_docs":3,"-integrate-adapters-cloud-posthog":529,"-integrate-adapters-cloud-posthog-surround":3363},[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],{"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",{"id":530,"title":531,"body":532,"description":3349,"extension":3350,"links":3351,"meta":3359,"navigation":3360,"path":157,"seo":3361,"stem":158,"__hash__":3362},"docs\u002F4.integrate\u002Fadapters\u002Fcloud\u002F02.posthog.md","PostHog Adapter",{"type":533,"value":534,"toc":3315},"minimark",[535,551,596,600,603,647,650,655,686,690,709,713,1291,1294,1297,1300,1330,1334,1375,1379,1386,1467,1471,1474,1531,1535,1684,1688,1698,1742,1746,1753,1762,1845,1852,1956,1960,1963,2020,2027,2063,2069,2086,2090,2096,2136,2164,2168,2174,2187,2191,2200,2295,2306,2312,2328,2332,2451,2455,2458,2546,2550,2556,2586,2590,2597,2608,2699,2702,2706,2781,2784,2923,2927,2931,2940,2943,2947,2950,2970,2974,2980,2993,2997,3000,3119,3122,3282,3286,3311],[536,537,538,544,545,550],"p",{},[539,540,156],"a",{"href":541,"rel":542},"https:\u002F\u002Fposthog.com",[543],"nofollow"," is an open-source product analytics platform. The evlog PostHog adapter sends your wide events to ",[539,546,549],{"href":547,"rel":548},"https:\u002F\u002Fposthog.com\u002Fdocs\u002Flogs",[543],"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.",[552,553,556,559,584],"prompt",{":actions":554,"description":555,"icon":159},"[\"copy\",\"cursor\",\"claude\"]","Add the PostHog drain adapter",[536,557,558],{},"Add the PostHog drain adapter to send evlog wide events to PostHog Logs.",[560,561,562,566,569,572,575,578,581],"ol",{},[563,564,565],"li",{},"Identify which framework I'm using and follow its evlog integration pattern",[563,567,568],{},"Install evlog if not already installed",[563,570,571],{},"Import createPostHogDrain from 'evlog\u002Fposthog'",[563,573,574],{},"Wire createPostHogDrain() into my framework's drain configuration",[563,576,577],{},"Set POSTHOG_API_KEY environment variable",[563,579,580],{},"Optionally set POSTHOG_HOST for EU or self-hosted instances",[563,582,583],{},"Test by triggering a request and checking PostHog > Logs",[536,585,586,587,591,592],{},"Adapter docs: ",[539,588,589],{"href":589,"rel":590},"https:\u002F\u002Fwww.evlog.dev\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fposthog",[543],"\nFramework setup: ",[539,593,594],{"href":594,"rel":595},"https:\u002F\u002Fwww.evlog.dev\u002Fintegrate\u002Fframeworks\u002Foverview",[543],[597,598,20],"h2",{"id":599},"installation",[536,601,602],{},"The PostHog adapter comes bundled with evlog:",[604,605,611],"pre",{"className":606,"code":607,"filename":608,"language":609,"meta":610,"style":610},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { createPostHogDrain } from 'evlog\u002Fposthog'\n","src\u002Findex.ts","typescript","",[612,613,614],"code",{"__ignoreMap":610},[615,616,619,623,627,631,634,637,640,644],"span",{"class":617,"line":618},"line",1,[615,620,622],{"class":621},"s7zQu","import",[615,624,626],{"class":625},"sMK4o"," {",[615,628,630],{"class":629},"sTEyZ"," createPostHogDrain",[615,632,633],{"class":625}," }",[615,635,636],{"class":621}," from",[615,638,639],{"class":625}," '",[615,641,643],{"class":642},"sfazB","evlog\u002Fposthog",[615,645,646],{"class":625},"'\n",[597,648,25],{"id":649},"quick-start",[651,652,654],"h3",{"id":653},"_1-get-your-posthog-project-api-key","1. Get your PostHog project API key",[560,656,657,665,679],{},[563,658,659,660],{},"Log in to your ",[539,661,664],{"href":662,"rel":663},"https:\u002F\u002Fapp.posthog.com",[543],"PostHog dashboard",[563,666,667,668,672,673,672,676],{},"Go to ",[669,670,671],"strong",{},"Settings"," > ",[669,674,675],{},"Project",[669,677,678],{},"Project API Key",[563,680,681,682,685],{},"Copy the key (starts with ",[612,683,684],{},"phc_",")",[651,687,689],{"id":688},"_2-set-environment-variables","2. Set environment variables",[604,691,696],{"className":692,"code":693,"filename":694,"language":695,"meta":610,"style":610},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","POSTHOG_API_KEY=phc_your-project-api-key\n",".env","bash",[612,697,698],{"__ignoreMap":610},[615,699,700,703,706],{"class":617,"line":618},[615,701,702],{"class":629},"POSTHOG_API_KEY",[615,704,705],{"class":625},"=",[615,707,708],{"class":642},"phc_your-project-api-key\n",[651,710,712],{"id":711},"_3-wire-the-drain-to-your-framework","3. Wire the drain to your framework",[714,715,716,830,961,1023,1077,1136,1190,1243],"code-group",{},[604,717,720],{"className":606,"code":718,"filename":719,"language":609,"meta":610,"style":610},"\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",[612,721,722,728,747,754,785,821],{"__ignoreMap":610},[615,723,724],{"class":617,"line":618},[615,725,727],{"class":726},"sHwdD","\u002F\u002F server\u002Fplugins\u002Fevlog-drain.ts\n",[615,729,731,733,735,737,739,741,743,745],{"class":617,"line":730},2,[615,732,622],{"class":621},[615,734,626],{"class":625},[615,736,630],{"class":629},[615,738,633],{"class":625},[615,740,636],{"class":621},[615,742,639],{"class":625},[615,744,643],{"class":642},[615,746,646],{"class":625},[615,748,750],{"class":617,"line":749},3,[615,751,753],{"emptyLinePlaceholder":752},true,"\n",[615,755,757,760,763,767,770,772,776,778,782],{"class":617,"line":756},4,[615,758,759],{"class":621},"export",[615,761,762],{"class":621}," default",[615,764,766],{"class":765},"s2Zo4"," defineNitroPlugin",[615,768,769],{"class":629},"(",[615,771,769],{"class":625},[615,773,775],{"class":774},"sHdIc","nitroApp",[615,777,685],{"class":625},[615,779,781],{"class":780},"spNyl"," =>",[615,783,784],{"class":625}," {\n",[615,786,788,791,794,797,799,802,805,808,811,813,816,818],{"class":617,"line":787},5,[615,789,790],{"class":629},"  nitroApp",[615,792,793],{"class":625},".",[615,795,796],{"class":629},"hooks",[615,798,793],{"class":625},[615,800,801],{"class":765},"hook",[615,803,769],{"class":804},"swJcz",[615,806,807],{"class":625},"'",[615,809,810],{"class":642},"evlog:drain",[615,812,807],{"class":625},[615,814,815],{"class":625},",",[615,817,630],{"class":765},[615,819,820],{"class":804},"())\n",[615,822,824,827],{"class":617,"line":823},6,[615,825,826],{"class":625},"}",[615,828,829],{"class":629},")\n",[604,831,833],{"className":606,"code":832,"filename":235,"language":609,"meta":610,"style":610},"\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",[612,834,835,840,860,878,882,921,939,954],{"__ignoreMap":610},[615,836,837],{"class":617,"line":618},[615,838,839],{"class":726},"\u002F\u002F lib\u002Fevlog.ts\n",[615,841,842,844,846,849,851,853,855,858],{"class":617,"line":730},[615,843,622],{"class":621},[615,845,626],{"class":625},[615,847,848],{"class":629}," createEvlog",[615,850,633],{"class":625},[615,852,636],{"class":621},[615,854,639],{"class":625},[615,856,857],{"class":642},"evlog\u002Fnext",[615,859,646],{"class":625},[615,861,862,864,866,868,870,872,874,876],{"class":617,"line":749},[615,863,622],{"class":621},[615,865,626],{"class":625},[615,867,630],{"class":629},[615,869,633],{"class":625},[615,871,636],{"class":621},[615,873,639],{"class":625},[615,875,643],{"class":642},[615,877,646],{"class":625},[615,879,880],{"class":617,"line":756},[615,881,753],{"emptyLinePlaceholder":752},[615,883,884,886,889,891,894,896,899,901,904,906,909,911,914,916,918],{"class":617,"line":787},[615,885,759],{"class":621},[615,887,888],{"class":780}," const",[615,890,626],{"class":625},[615,892,893],{"class":629}," withEvlog",[615,895,815],{"class":625},[615,897,898],{"class":629}," useLogger",[615,900,815],{"class":625},[615,902,903],{"class":629}," log",[615,905,815],{"class":625},[615,907,908],{"class":629}," createError ",[615,910,826],{"class":625},[615,912,913],{"class":625}," =",[615,915,848],{"class":765},[615,917,769],{"class":629},[615,919,920],{"class":625},"{\n",[615,922,923,926,929,931,934,936],{"class":617,"line":823},[615,924,925],{"class":804},"  service",[615,927,928],{"class":625},":",[615,930,639],{"class":625},[615,932,933],{"class":642},"my-app",[615,935,807],{"class":625},[615,937,938],{"class":625},",\n",[615,940,942,945,947,949,952],{"class":617,"line":941},7,[615,943,944],{"class":804},"  drain",[615,946,928],{"class":625},[615,948,630],{"class":765},[615,950,951],{"class":629},"()",[615,953,938],{"class":625},[615,955,957,959],{"class":617,"line":956},8,[615,958,826],{"class":625},[615,960,829],{"class":629},[604,962,964],{"className":606,"code":963,"filename":265,"language":609,"meta":610,"style":610},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\napp.use(evlog({ drain: createPostHogDrain() }))\n",[612,965,966,984,988],{"__ignoreMap":610},[615,967,968,970,972,974,976,978,980,982],{"class":617,"line":618},[615,969,622],{"class":621},[615,971,626],{"class":625},[615,973,630],{"class":629},[615,975,633],{"class":625},[615,977,636],{"class":621},[615,979,639],{"class":625},[615,981,643],{"class":642},[615,983,646],{"class":625},[615,985,986],{"class":617,"line":730},[615,987,753],{"emptyLinePlaceholder":752},[615,989,990,993,995,998,1000,1003,1005,1008,1011,1013,1015,1018,1020],{"class":617,"line":749},[615,991,992],{"class":629},"app",[615,994,793],{"class":625},[615,996,997],{"class":765},"use",[615,999,769],{"class":629},[615,1001,1002],{"class":765},"evlog",[615,1004,769],{"class":629},[615,1006,1007],{"class":625},"{",[615,1009,1010],{"class":804}," drain",[615,1012,928],{"class":625},[615,1014,630],{"class":765},[615,1016,1017],{"class":629},"() ",[615,1019,826],{"class":625},[615,1021,1022],{"class":629},"))\n",[604,1024,1025],{"className":606,"code":963,"filename":260,"language":609,"meta":610,"style":610},[612,1026,1027,1045,1049],{"__ignoreMap":610},[615,1028,1029,1031,1033,1035,1037,1039,1041,1043],{"class":617,"line":618},[615,1030,622],{"class":621},[615,1032,626],{"class":625},[615,1034,630],{"class":629},[615,1036,633],{"class":625},[615,1038,636],{"class":621},[615,1040,639],{"class":625},[615,1042,643],{"class":642},[615,1044,646],{"class":625},[615,1046,1047],{"class":617,"line":730},[615,1048,753],{"emptyLinePlaceholder":752},[615,1050,1051,1053,1055,1057,1059,1061,1063,1065,1067,1069,1071,1073,1075],{"class":617,"line":749},[615,1052,992],{"class":629},[615,1054,793],{"class":625},[615,1056,997],{"class":765},[615,1058,769],{"class":629},[615,1060,1002],{"class":765},[615,1062,769],{"class":629},[615,1064,1007],{"class":625},[615,1066,1010],{"class":804},[615,1068,928],{"class":625},[615,1070,630],{"class":765},[615,1072,1017],{"class":629},[615,1074,826],{"class":625},[615,1076,1022],{"class":629},[604,1078,1080],{"className":606,"code":1079,"filename":270,"language":609,"meta":610,"style":610},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\nawait app.register(evlog, { drain: createPostHogDrain() })\n",[612,1081,1082,1100,1104],{"__ignoreMap":610},[615,1083,1084,1086,1088,1090,1092,1094,1096,1098],{"class":617,"line":618},[615,1085,622],{"class":621},[615,1087,626],{"class":625},[615,1089,630],{"class":629},[615,1091,633],{"class":625},[615,1093,636],{"class":621},[615,1095,639],{"class":625},[615,1097,643],{"class":642},[615,1099,646],{"class":625},[615,1101,1102],{"class":617,"line":730},[615,1103,753],{"emptyLinePlaceholder":752},[615,1105,1106,1109,1112,1114,1117,1120,1122,1124,1126,1128,1130,1132,1134],{"class":617,"line":749},[615,1107,1108],{"class":621},"await",[615,1110,1111],{"class":629}," app",[615,1113,793],{"class":625},[615,1115,1116],{"class":765},"register",[615,1118,1119],{"class":629},"(evlog",[615,1121,815],{"class":625},[615,1123,626],{"class":625},[615,1125,1010],{"class":804},[615,1127,928],{"class":625},[615,1129,630],{"class":765},[615,1131,1017],{"class":629},[615,1133,826],{"class":625},[615,1135,829],{"class":629},[604,1137,1138],{"className":606,"code":963,"filename":275,"language":609,"meta":610,"style":610},[612,1139,1140,1158,1162],{"__ignoreMap":610},[615,1141,1142,1144,1146,1148,1150,1152,1154,1156],{"class":617,"line":618},[615,1143,622],{"class":621},[615,1145,626],{"class":625},[615,1147,630],{"class":629},[615,1149,633],{"class":625},[615,1151,636],{"class":621},[615,1153,639],{"class":625},[615,1155,643],{"class":642},[615,1157,646],{"class":625},[615,1159,1160],{"class":617,"line":730},[615,1161,753],{"emptyLinePlaceholder":752},[615,1163,1164,1166,1168,1170,1172,1174,1176,1178,1180,1182,1184,1186,1188],{"class":617,"line":749},[615,1165,992],{"class":629},[615,1167,793],{"class":625},[615,1169,997],{"class":765},[615,1171,769],{"class":629},[615,1173,1002],{"class":765},[615,1175,769],{"class":629},[615,1177,1007],{"class":625},[615,1179,1010],{"class":804},[615,1181,928],{"class":625},[615,1183,630],{"class":765},[615,1185,1017],{"class":629},[615,1187,826],{"class":625},[615,1189,1022],{"class":629},[604,1191,1193],{"className":606,"code":1192,"filename":255,"language":609,"meta":610,"style":610},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\nEvlogModule.forRoot({ drain: createPostHogDrain() })\n",[612,1194,1195,1213,1217],{"__ignoreMap":610},[615,1196,1197,1199,1201,1203,1205,1207,1209,1211],{"class":617,"line":618},[615,1198,622],{"class":621},[615,1200,626],{"class":625},[615,1202,630],{"class":629},[615,1204,633],{"class":625},[615,1206,636],{"class":621},[615,1208,639],{"class":625},[615,1210,643],{"class":642},[615,1212,646],{"class":625},[615,1214,1215],{"class":617,"line":730},[615,1216,753],{"emptyLinePlaceholder":752},[615,1218,1219,1222,1224,1227,1229,1231,1233,1235,1237,1239,1241],{"class":617,"line":749},[615,1220,1221],{"class":629},"EvlogModule",[615,1223,793],{"class":625},[615,1225,1226],{"class":765},"forRoot",[615,1228,769],{"class":629},[615,1230,1007],{"class":625},[615,1232,1010],{"class":804},[615,1234,928],{"class":625},[615,1236,630],{"class":765},[615,1238,1017],{"class":629},[615,1240,826],{"class":625},[615,1242,829],{"class":629},[604,1244,1246],{"className":606,"code":1245,"filename":290,"language":609,"meta":610,"style":610},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\ninitLogger({ drain: createPostHogDrain() })\n",[612,1247,1248,1266,1270],{"__ignoreMap":610},[615,1249,1250,1252,1254,1256,1258,1260,1262,1264],{"class":617,"line":618},[615,1251,622],{"class":621},[615,1253,626],{"class":625},[615,1255,630],{"class":629},[615,1257,633],{"class":625},[615,1259,636],{"class":621},[615,1261,639],{"class":625},[615,1263,643],{"class":642},[615,1265,646],{"class":625},[615,1267,1268],{"class":617,"line":730},[615,1269,753],{"emptyLinePlaceholder":752},[615,1271,1272,1275,1277,1279,1281,1283,1285,1287,1289],{"class":617,"line":749},[615,1273,1274],{"class":765},"initLogger",[615,1276,769],{"class":629},[615,1278,1007],{"class":625},[615,1280,1010],{"class":804},[615,1282,928],{"class":625},[615,1284,630],{"class":765},[615,1286,1017],{"class":629},[615,1288,826],{"class":625},[615,1290,829],{"class":629},[536,1292,1293],{},"That's it! Your wide events will now appear in PostHog Logs with full OTLP structure including severity levels, trace context, and structured attributes.",[597,1295,504],{"id":1296},"configuration",[536,1298,1299],{},"The adapter reads configuration from multiple sources (highest priority first):",[560,1301,1302,1311,1321],{},[563,1303,1304,1307,1308],{},[669,1305,1306],{},"Overrides"," passed to ",[612,1309,1310],{},"createPostHogDrain()",[563,1312,1313,1316,1317,1320],{},[669,1314,1315],{},"Runtime config"," at ",[612,1318,1319],{},"runtimeConfig.posthog"," (Nuxt\u002FNitro only)",[563,1322,1323,1326,1327,685],{},[669,1324,1325],{},"Environment variables"," (",[612,1328,1329],{},"POSTHOG_*",[651,1331,1333],{"id":1332},"environment-variables","Environment Variables",[1335,1336,1337,1350],"table",{},[1338,1339,1340],"thead",{},[1341,1342,1343,1347],"tr",{},[1344,1345,1346],"th",{},"Variable",[1344,1348,1349],{},"Description",[1351,1352,1353,1365],"tbody",{},[1341,1354,1355,1360],{},[1356,1357,1358],"td",{},[612,1359,702],{},[1356,1361,1362,1363,685],{},"Project API key (starts with ",[612,1364,684],{},[1341,1366,1367,1372],{},[1356,1368,1369],{},[612,1370,1371],{},"POSTHOG_HOST",[1356,1373,1374],{},"PostHog host URL (for EU or self-hosted)",[651,1376,1378],{"id":1377},"runtime-config-nuxt-only","Runtime Config (Nuxt only)",[536,1380,1381,1382,1385],{},"Configure via ",[612,1383,1384],{},"nuxt.config.ts"," for type-safe configuration:",[604,1387,1389],{"className":606,"code":1388,"filename":1384,"language":609,"meta":610,"style":610},"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",[612,1390,1391,1404,1413,1422,1437,1451,1456,1461],{"__ignoreMap":610},[615,1392,1393,1395,1397,1400,1402],{"class":617,"line":618},[615,1394,759],{"class":621},[615,1396,762],{"class":621},[615,1398,1399],{"class":765}," defineNuxtConfig",[615,1401,769],{"class":629},[615,1403,920],{"class":625},[615,1405,1406,1409,1411],{"class":617,"line":730},[615,1407,1408],{"class":804},"  runtimeConfig",[615,1410,928],{"class":625},[615,1412,784],{"class":625},[615,1414,1415,1418,1420],{"class":617,"line":749},[615,1416,1417],{"class":804},"    posthog",[615,1419,928],{"class":625},[615,1421,784],{"class":625},[615,1423,1424,1427,1429,1432,1434],{"class":617,"line":756},[615,1425,1426],{"class":804},"      apiKey",[615,1428,928],{"class":625},[615,1430,1431],{"class":625}," ''",[615,1433,815],{"class":625},[615,1435,1436],{"class":726}," \u002F\u002F Set via POSTHOG_API_KEY\n",[615,1438,1439,1442,1444,1446,1448],{"class":617,"line":787},[615,1440,1441],{"class":804},"      host",[615,1443,928],{"class":625},[615,1445,1431],{"class":625},[615,1447,815],{"class":625},[615,1449,1450],{"class":726}," \u002F\u002F Set via POSTHOG_HOST\n",[615,1452,1453],{"class":617,"line":823},[615,1454,1455],{"class":625},"    },\n",[615,1457,1458],{"class":617,"line":941},[615,1459,1460],{"class":625},"  },\n",[615,1462,1463,1465],{"class":617,"line":956},[615,1464,826],{"class":625},[615,1466,829],{"class":629},[651,1468,1470],{"id":1469},"override-options","Override Options",[536,1472,1473],{},"Pass options directly to override any configuration:",[604,1475,1478],{"className":606,"code":1476,"filename":1477,"language":609,"meta":610,"style":610},"const drain = createPostHogDrain({\n  host: 'https:\u002F\u002Feu.i.posthog.com',\n  timeout: 10000,\n})\n","server\u002Fplugins\u002Fevlog-drain.ts",[612,1479,1480,1496,1512,1525],{"__ignoreMap":610},[615,1481,1482,1485,1488,1490,1492,1494],{"class":617,"line":618},[615,1483,1484],{"class":780},"const",[615,1486,1487],{"class":629}," drain ",[615,1489,705],{"class":625},[615,1491,630],{"class":765},[615,1493,769],{"class":629},[615,1495,920],{"class":625},[615,1497,1498,1501,1503,1505,1508,1510],{"class":617,"line":730},[615,1499,1500],{"class":804},"  host",[615,1502,928],{"class":625},[615,1504,639],{"class":625},[615,1506,1507],{"class":642},"https:\u002F\u002Feu.i.posthog.com",[615,1509,807],{"class":625},[615,1511,938],{"class":625},[615,1513,1514,1517,1519,1523],{"class":617,"line":749},[615,1515,1516],{"class":804},"  timeout",[615,1518,928],{"class":625},[615,1520,1522],{"class":1521},"sbssI"," 10000",[615,1524,938],{"class":625},[615,1526,1527,1529],{"class":617,"line":756},[615,1528,826],{"class":625},[615,1530,829],{"class":629},[651,1532,1534],{"id":1533},"full-configuration-reference","Full Configuration Reference",[1335,1536,1537,1552],{},[1338,1538,1539],{},[1341,1540,1541,1544,1547,1550],{},[1344,1542,1543],{},"Option",[1344,1545,1546],{},"Type",[1344,1548,1549],{},"Default",[1344,1551,1349],{},[1351,1553,1554,1572,1591,1607,1626,1645,1665],{},[1341,1555,1556,1561,1566,1569],{},[1356,1557,1558],{},[612,1559,1560],{},"apiKey",[1356,1562,1563],{},[612,1564,1565],{},"string",[1356,1567,1568],{},"-",[1356,1570,1571],{},"Project API key (required)",[1341,1573,1574,1579,1583,1588],{},[1356,1575,1576],{},[612,1577,1578],{},"host",[1356,1580,1581],{},[612,1582,1565],{},[1356,1584,1585],{},[612,1586,1587],{},"https:\u002F\u002Fus.i.posthog.com",[1356,1589,1590],{},"PostHog host URL",[1341,1592,1593,1598,1602,1604],{},[1356,1594,1595],{},[612,1596,1597],{},"distinctId",[1356,1599,1600],{},[612,1601,1565],{},[1356,1603,1568],{},[1356,1605,1606],{},"Static person identifier for every event",[1341,1608,1609,1614,1618,1623],{},[1356,1610,1611],{},[612,1612,1613],{},"distinctIdField",[1356,1615,1616],{},[612,1617,1565],{},[1356,1619,1620],{},[612,1621,1622],{},"userId",[1356,1624,1625],{},"Event field holding the person identifier (dot path)",[1341,1627,1628,1633,1637,1642],{},[1356,1629,1630],{},[612,1631,1632],{},"sessionIdField",[1356,1634,1635],{},[612,1636,1565],{},[1356,1638,1639],{},[612,1640,1641],{},"sessionId",[1356,1643,1644],{},"Event field holding the PostHog session id (dot path)",[1341,1646,1647,1652,1657,1662],{},[1356,1648,1649],{},[612,1650,1651],{},"timeout",[1356,1653,1654],{},[612,1655,1656],{},"number",[1356,1658,1659],{},[612,1660,1661],{},"5000",[1356,1663,1664],{},"Request timeout in milliseconds",[1341,1666,1667,1672,1676,1681],{},[1356,1668,1669],{},[612,1670,1671],{},"retries",[1356,1673,1674],{},[612,1675,1656],{},[1356,1677,1678],{},[612,1679,1680],{},"2",[1356,1682,1683],{},"Retry attempts on transient failures",[597,1685,1687],{"id":1686},"how-it-works","How It Works",[536,1689,1690,1691,1693,1694,1697],{},"Under the hood, ",[612,1692,1310],{}," wraps the OTLP adapter's ",[612,1695,1696],{},"sendBatchToOTLP()"," with PostHog-specific defaults:",[1699,1700,1701,1711,1720,1730],"ul",{},[563,1702,1703,1706,1707,1710],{},[669,1704,1705],{},"Endpoint",": ",[612,1708,1709],{},"{host}\u002Fi\u002Fv1\u002Flogs"," (PostHog's OTLP log ingest endpoint)",[563,1712,1713,1706,1716,1719],{},[669,1714,1715],{},"Auth",[612,1717,1718],{},"Authorization: Bearer {apiKey}"," header",[563,1721,1722,1725,1726,1729],{},[669,1723,1724],{},"Format",": Standard OTLP ",[612,1727,1728],{},"ExportLogsServiceRequest"," with severity levels, trace context, and structured attributes",[563,1731,1732,1706,1735,1738,1739,1741],{},[669,1733,1734],{},"Identity",[612,1736,1737],{},"posthogDistinctId"," and ",[612,1740,1641],{}," attributes, which is how PostHog joins a log to the rest of your project data",[597,1743,1745],{"id":1744},"linking-logs-to-people-and-session-replays","Linking Logs to People and Session Replays",[536,1747,1748,1749,1752],{},"A log that carries a person identifier shows up on that person's profile in PostHog, under the ",[669,1750,1751],{},"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.",[536,1754,1755,1756,1758,1759,1761],{},"PostHog reads both from log attributes: ",[612,1757,1737],{}," for the person, ",[612,1760,1641],{}," for the replay. The adapter fills them from your wide event, so this works as soon as your event carries the values:",[604,1763,1766],{"className":606,"code":1764,"filename":1765,"language":609,"meta":610,"style":610},"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",[612,1767,1768,1782,1786,1800,1820,1839],{"__ignoreMap":610},[615,1769,1770,1772,1775,1777,1779],{"class":617,"line":618},[615,1771,1484],{"class":780},[615,1773,1774],{"class":629}," log ",[615,1776,705],{"class":625},[615,1778,898],{"class":765},[615,1780,1781],{"class":629},"(event)\n",[615,1783,1784],{"class":617,"line":730},[615,1785,753],{"emptyLinePlaceholder":752},[615,1787,1788,1791,1793,1796,1798],{"class":617,"line":749},[615,1789,1790],{"class":629},"log",[615,1792,793],{"class":625},[615,1794,1795],{"class":765},"set",[615,1797,769],{"class":629},[615,1799,920],{"class":625},[615,1801,1802,1805,1807,1810,1812,1815,1817],{"class":617,"line":756},[615,1803,1804],{"class":804},"  userId",[615,1806,928],{"class":625},[615,1808,1809],{"class":629}," user",[615,1811,793],{"class":625},[615,1813,1814],{"class":629},"id",[615,1816,815],{"class":625},[615,1818,1819],{"class":726}," \u002F\u002F → posthogDistinctId, links to the person\n",[615,1821,1822,1825,1827,1830,1832,1834,1836],{"class":617,"line":787},[615,1823,1824],{"class":804},"  sessionId",[615,1826,928],{"class":625},[615,1828,1829],{"class":629}," body",[615,1831,793],{"class":625},[615,1833,1641],{"class":629},[615,1835,815],{"class":625},[615,1837,1838],{"class":726}," \u002F\u002F → sessionId, links to the session replay\n",[615,1840,1841,1843],{"class":617,"line":823},[615,1842,826],{"class":625},[615,1844,829],{"class":629},[536,1846,1847,1848,1851],{},"The session id comes from the frontend — read it with ",[612,1849,1850],{},"posthog.get_session_id()"," and send it along with the request:",[604,1853,1856],{"className":606,"code":1854,"filename":1855,"language":609,"meta":610,"style":610},"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",[612,1857,1858,1875,1879,1899,1915,1950],{"__ignoreMap":610},[615,1859,1860,1862,1865,1868,1870,1873],{"class":617,"line":618},[615,1861,622],{"class":621},[615,1863,1864],{"class":629}," posthog ",[615,1866,1867],{"class":621},"from",[615,1869,639],{"class":625},[615,1871,1872],{"class":642},"posthog-js",[615,1874,646],{"class":625},[615,1876,1877],{"class":617,"line":730},[615,1878,753],{"emptyLinePlaceholder":752},[615,1880,1881,1883,1886,1888,1890,1893,1895,1897],{"class":617,"line":749},[615,1882,1108],{"class":621},[615,1884,1885],{"class":765}," $fetch",[615,1887,769],{"class":629},[615,1889,807],{"class":625},[615,1891,1892],{"class":642},"\u002Fapi\u002Fcheckout",[615,1894,807],{"class":625},[615,1896,815],{"class":625},[615,1898,784],{"class":625},[615,1900,1901,1904,1906,1908,1911,1913],{"class":617,"line":756},[615,1902,1903],{"class":804},"  method",[615,1905,928],{"class":625},[615,1907,639],{"class":625},[615,1909,1910],{"class":642},"POST",[615,1912,807],{"class":625},[615,1914,938],{"class":625},[615,1916,1917,1920,1922,1924,1927,1930,1932,1935,1937,1940,1942,1945,1947],{"class":617,"line":787},[615,1918,1919],{"class":804},"  body",[615,1921,928],{"class":625},[615,1923,626],{"class":625},[615,1925,1926],{"class":625}," ...",[615,1928,1929],{"class":629},"payload",[615,1931,815],{"class":625},[615,1933,1934],{"class":804}," sessionId",[615,1936,928],{"class":625},[615,1938,1939],{"class":629}," posthog",[615,1941,793],{"class":625},[615,1943,1944],{"class":765},"get_session_id",[615,1946,1017],{"class":629},[615,1948,1949],{"class":625},"},\n",[615,1951,1952,1954],{"class":617,"line":823},[615,1953,826],{"class":625},[615,1955,829],{"class":629},[651,1957,1959],{"id":1958},"pointing-at-your-own-fields","Pointing at Your Own Fields",[536,1961,1962],{},"When identity lives somewhere else on your events, point the adapter at it. Both options take a dot path:",[604,1964,1966],{"className":606,"code":1965,"filename":1477,"language":609,"meta":610,"style":610},"const drain = createPostHogDrain({\n  distinctIdField: 'user.id',\n  sessionIdField: 'session.id',\n})\n",[612,1967,1968,1982,1998,2014],{"__ignoreMap":610},[615,1969,1970,1972,1974,1976,1978,1980],{"class":617,"line":618},[615,1971,1484],{"class":780},[615,1973,1487],{"class":629},[615,1975,705],{"class":625},[615,1977,630],{"class":765},[615,1979,769],{"class":629},[615,1981,920],{"class":625},[615,1983,1984,1987,1989,1991,1994,1996],{"class":617,"line":730},[615,1985,1986],{"class":804},"  distinctIdField",[615,1988,928],{"class":625},[615,1990,639],{"class":625},[615,1992,1993],{"class":642},"user.id",[615,1995,807],{"class":625},[615,1997,938],{"class":625},[615,1999,2000,2003,2005,2007,2010,2012],{"class":617,"line":749},[615,2001,2002],{"class":804},"  sessionIdField",[615,2004,928],{"class":625},[615,2006,639],{"class":625},[615,2008,2009],{"class":642},"session.id",[615,2011,807],{"class":625},[615,2013,938],{"class":625},[615,2015,2016,2018],{"class":617,"line":756},[615,2017,826],{"class":625},[615,2019,829],{"class":629},[536,2021,2022,2023,2026],{},"For an ",[539,2024,2025],{"href":437},"eve agent",", the caller principal is the identity eve itself routes on:",[604,2028,2031],{"className":606,"code":2029,"filename":2030,"language":609,"meta":610,"style":610},"const drain = createPostHogDrain({ distinctIdField: 'eve.caller.principalId' })\n","agent\u002Fhooks\u002Fevlog.ts",[612,2032,2033],{"__ignoreMap":610},[615,2034,2035,2037,2039,2041,2043,2045,2047,2050,2052,2054,2057,2059,2061],{"class":617,"line":618},[615,2036,1484],{"class":780},[615,2038,1487],{"class":629},[615,2040,705],{"class":625},[615,2042,630],{"class":765},[615,2044,769],{"class":629},[615,2046,1007],{"class":625},[615,2048,2049],{"class":804}," distinctIdField",[615,2051,928],{"class":625},[615,2053,639],{"class":625},[615,2055,2056],{"class":642},"eve.caller.principalId",[615,2058,807],{"class":625},[615,2060,633],{"class":625},[615,2062,829],{"class":629},[536,2064,2065,2066,2068],{},"A static ",[612,2067,1597],{}," overrides the field lookup entirely — use it for a backend that acts as one identity rather than on behalf of users.",[2070,2071,2073,2074,2077,2078,672,2080,2082,2083,2085],"callout",{"color":2072,"icon":13},"info","PostHog matches the attribute value against every ",[612,2075,2076],{},"distinct_id"," it knows for a person, so any one of their identifiers works. The attribute key is configurable per project under ",[669,2079,671],{},[669,2081,1751],{}," — leave it at the default ",[612,2084,1737],{}," and this works out of the box.",[597,2087,2089],{"id":2088},"regions","Regions",[536,2091,2092,2093,2095],{},"PostHog offers US and EU cloud hosting. Set the ",[612,2094,1578],{}," to match your region:",[1335,2097,2098,2108],{},[1338,2099,2100],{},[1341,2101,2102,2105],{},[1344,2103,2104],{},"Region",[1344,2106,2107],{},"Host",[1351,2109,2110,2119,2128],{},[1341,2111,2112,2115],{},[1356,2113,2114],{},"US (default)",[1356,2116,2117],{},[612,2118,1587],{},[1341,2120,2121,2124],{},[1356,2122,2123],{},"EU",[1356,2125,2126],{},[612,2127,1507],{},[1341,2129,2130,2133],{},[1356,2131,2132],{},"Self-hosted",[1356,2134,2135],{},"Your instance URL",[604,2137,2139],{"className":692,"code":2138,"filename":694,"language":695,"meta":610,"style":610},"# EU region\nPOSTHOG_API_KEY=phc_xxx\nPOSTHOG_HOST=https:\u002F\u002Feu.i.posthog.com\n",[612,2140,2141,2146,2155],{"__ignoreMap":610},[615,2142,2143],{"class":617,"line":618},[615,2144,2145],{"class":726},"# EU region\n",[615,2147,2148,2150,2152],{"class":617,"line":730},[615,2149,702],{"class":629},[615,2151,705],{"class":625},[615,2153,2154],{"class":642},"phc_xxx\n",[615,2156,2157,2159,2161],{"class":617,"line":749},[615,2158,1371],{"class":629},[615,2160,705],{"class":625},[615,2162,2163],{"class":642},"https:\u002F\u002Feu.i.posthog.com\n",[597,2165,2167],{"id":2166},"querying-logs-in-posthog","Querying Logs in PostHog",[536,2169,2170,2171,2173],{},"Once your logs are flowing, use the ",[669,2172,1751],{}," tab in PostHog to query them:",[560,2175,2176,2181,2184],{},[563,2177,667,2178,2180],{},[669,2179,1751],{}," and filter by service, severity, or any structured attribute",[563,2182,2183],{},"Use the search bar to find specific log entries",[563,2185,2186],{},"Click on a log entry to see all structured attributes",[597,2188,2190],{"id":2189},"posthog-events-custom-events","PostHog Events (Custom Events)",[536,2192,2193,2194,2196,2197,928],{},"If you prefer sending logs as PostHog custom events (e.g., for product analytics, cohorts, or funnels), use ",[612,2195,1310],{}," with ",[612,2198,2199],{},"mode: 'events'",[604,2201,2203],{"className":606,"code":2202,"filename":1477,"language":609,"meta":610,"style":610},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\nconst drain = createPostHogDrain({\n  mode: 'events',\n  eventName: 'server_request',\n  distinctId: 'my-backend-service',\n})\n",[612,2204,2205,2223,2227,2241,2257,2273,2289],{"__ignoreMap":610},[615,2206,2207,2209,2211,2213,2215,2217,2219,2221],{"class":617,"line":618},[615,2208,622],{"class":621},[615,2210,626],{"class":625},[615,2212,630],{"class":629},[615,2214,633],{"class":625},[615,2216,636],{"class":621},[615,2218,639],{"class":625},[615,2220,643],{"class":642},[615,2222,646],{"class":625},[615,2224,2225],{"class":617,"line":730},[615,2226,753],{"emptyLinePlaceholder":752},[615,2228,2229,2231,2233,2235,2237,2239],{"class":617,"line":749},[615,2230,1484],{"class":780},[615,2232,1487],{"class":629},[615,2234,705],{"class":625},[615,2236,630],{"class":765},[615,2238,769],{"class":629},[615,2240,920],{"class":625},[615,2242,2243,2246,2248,2250,2253,2255],{"class":617,"line":756},[615,2244,2245],{"class":804},"  mode",[615,2247,928],{"class":625},[615,2249,639],{"class":625},[615,2251,2252],{"class":642},"events",[615,2254,807],{"class":625},[615,2256,938],{"class":625},[615,2258,2259,2262,2264,2266,2269,2271],{"class":617,"line":787},[615,2260,2261],{"class":804},"  eventName",[615,2263,928],{"class":625},[615,2265,639],{"class":625},[615,2267,2268],{"class":642},"server_request",[615,2270,807],{"class":625},[615,2272,938],{"class":625},[615,2274,2275,2278,2280,2282,2285,2287],{"class":617,"line":823},[615,2276,2277],{"class":804},"  distinctId",[615,2279,928],{"class":625},[615,2281,639],{"class":625},[615,2283,2284],{"class":642},"my-backend-service",[615,2286,807],{"class":625},[615,2288,938],{"class":625},[615,2290,2291,2293],{"class":617,"line":941},[615,2292,826],{"class":625},[615,2294,829],{"class":629},[536,2296,2297,2298,2301,2302,2305],{},"Then pass ",[612,2299,2300],{},"drain"," to your framework the same way as the default logs drain (see ",[539,2303,25],{"href":2304},"#quick-start"," above).",[2070,2307,2308,2309,2311],{"color":2072,"icon":13},"Custom events count towards your PostHog event quota. PostHog Logs (the default ",[612,2310,1310],{},") is significantly cheaper.",[2070,2313,2316,2319,2320,2323,2324,2327],{"color":2314,"icon":2315},"warning","i-lucide-triangle-alert",[669,2317,2318],{},"Legacy:"," ",[612,2321,2322],{},"createPostHogEventsDrain()"," is deprecated and re-routes to ",[612,2325,2326],{},"createPostHogDrain({ mode: 'events' })",". It will be removed in the next major release.",[651,2329,2331],{"id":2330},"events-configuration","Events Configuration",[1335,2333,2334,2346],{},[1338,2335,2336],{},[1341,2337,2338,2340,2342,2344],{},[1344,2339,1543],{},[1344,2341,1546],{},[1344,2343,1549],{},[1344,2345,1349],{},[1351,2347,2348,2362,2378,2397,2415,2435],{},[1341,2349,2350,2354,2358,2360],{},[1356,2351,2352],{},[612,2353,1560],{},[1356,2355,2356],{},[612,2357,1565],{},[1356,2359,1568],{},[1356,2361,1571],{},[1341,2363,2364,2368,2372,2376],{},[1356,2365,2366],{},[612,2367,1578],{},[1356,2369,2370],{},[612,2371,1565],{},[1356,2373,2374],{},[612,2375,1587],{},[1356,2377,1590],{},[1341,2379,2380,2385,2389,2394],{},[1356,2381,2382],{},[612,2383,2384],{},"eventName",[1356,2386,2387],{},[612,2388,1565],{},[1356,2390,2391],{},[612,2392,2393],{},"evlog_wide_event",[1356,2395,2396],{},"PostHog event name",[1341,2398,2399,2403,2407,2409],{},[1356,2400,2401],{},[612,2402,1597],{},[1356,2404,2405],{},[612,2406,1565],{},[1356,2408,1568],{},[1356,2410,2411,2412,2414],{},"Static ",[612,2413,2076],{}," for all events",[1341,2416,2417,2421,2425,2429],{},[1356,2418,2419],{},[612,2420,1613],{},[1356,2422,2423],{},[612,2424,1565],{},[1356,2426,2427],{},[612,2428,1622],{},[1356,2430,2431,2432,2434],{},"Event field holding the ",[612,2433,2076],{}," (dot path)",[1341,2436,2437,2441,2445,2449],{},[1356,2438,2439],{},[612,2440,1651],{},[1356,2442,2443],{},[612,2444,1656],{},[1356,2446,2447],{},[612,2448,1661],{},[1356,2450,1664],{},[651,2452,2454],{"id":2453},"event-format","Event Format",[536,2456,2457],{},"evlog maps wide events to PostHog events:",[1335,2459,2460,2470],{},[1338,2461,2462],{},[1341,2463,2464,2467],{},[1344,2465,2466],{},"evlog Field",[1344,2468,2469],{},"PostHog Field",[1351,2471,2472,2490,2501,2513,2524,2536],{},[1341,2473,2474,2485],{},[1356,2475,2476,2479,2480,2479,2482],{},[612,2477,2478],{},"config.distinctId"," or ",[612,2481,1622],{},[612,2483,2484],{},"service",[1356,2486,2487,2489],{},[612,2488,2076],{}," (fallback chain)",[1341,2491,2492,2497],{},[1356,2493,2494],{},[612,2495,2496],{},"timestamp",[1356,2498,2499],{},[612,2500,2496],{},[1341,2502,2503,2508],{},[1356,2504,2505],{},[612,2506,2507],{},"level",[1356,2509,2510],{},[612,2511,2512],{},"properties.level",[1341,2514,2515,2519],{},[1356,2516,2517],{},[612,2518,2484],{},[1356,2520,2521],{},[612,2522,2523],{},"properties.service",[1341,2525,2526,2531],{},[1356,2527,2528],{},[612,2529,2530],{},"environment",[1356,2532,2533],{},[612,2534,2535],{},"properties.environment",[1341,2537,2538,2541],{},[1356,2539,2540],{},"All other fields",[1356,2542,2543],{},[612,2544,2545],{},"properties.*",[651,2547,2549],{"id":2548},"distinct-id-resolution","Distinct ID Resolution",[536,2551,2552,2553,2555],{},"The ",[612,2554,2076],{}," follows a fallback chain:",[560,2557,2558,2567,2578],{},[563,2559,2560,2564,2565],{},[669,2561,2562],{},[612,2563,2478],{}," - explicit override in ",[612,2566,2326],{},[563,2568,2569,2574,2575,2577],{},[669,2570,2571],{},[612,2572,2573],{},"event.userId"," - or whatever ",[612,2576,1613],{}," points at, when it holds a string or a number",[563,2579,2580,2585],{},[669,2581,2582],{},[612,2583,2584],{},"event.service"," - final fallback, sent as an anonymous event",[651,2587,2589],{"id":2588},"identified-vs-anonymous-events","Identified vs Anonymous Events",[536,2591,2592,2593,2596],{},"An event that resolves to a real person is an ",[669,2594,2595],{},"identified"," event: PostHog creates a person profile for it and attaches person properties.",[536,2598,2599,2600,2603,2604,2607],{},"When no identifier resolves, the event is sent as ",[669,2601,2602],{},"anonymous"," — ",[612,2605,2606],{},"$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.",[604,2609,2611],{"className":606,"code":2610,"filename":1477,"language":609,"meta":610,"style":610},"\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",[612,2612,2613,2618,2647,2651,2656],{"__ignoreMap":610},[615,2614,2615],{"class":617,"line":618},[615,2616,2617],{"class":726},"\u002F\u002F Identified: events carrying `userId` create and update a person profile\n",[615,2619,2620,2622,2624,2626,2628,2630,2632,2635,2637,2639,2641,2643,2645],{"class":617,"line":730},[615,2621,1484],{"class":780},[615,2623,1487],{"class":629},[615,2625,705],{"class":625},[615,2627,630],{"class":765},[615,2629,769],{"class":629},[615,2631,1007],{"class":625},[615,2633,2634],{"class":804}," mode",[615,2636,928],{"class":625},[615,2638,639],{"class":625},[615,2640,2252],{"class":642},[615,2642,807],{"class":625},[615,2644,633],{"class":625},[615,2646,829],{"class":629},[615,2648,2649],{"class":617,"line":749},[615,2650,753],{"emptyLinePlaceholder":752},[615,2652,2653],{"class":617,"line":756},[615,2654,2655],{"class":726},"\u002F\u002F Identified as one backend identity, whatever the request\n",[615,2657,2658,2660,2663,2665,2667,2669,2671,2673,2675,2677,2679,2681,2683,2686,2688,2690,2693,2695,2697],{"class":617,"line":787},[615,2659,1484],{"class":780},[615,2661,2662],{"class":629}," service ",[615,2664,705],{"class":625},[615,2666,630],{"class":765},[615,2668,769],{"class":629},[615,2670,1007],{"class":625},[615,2672,2634],{"class":804},[615,2674,928],{"class":625},[615,2676,639],{"class":625},[615,2678,2252],{"class":642},[615,2680,807],{"class":625},[615,2682,815],{"class":625},[615,2684,2685],{"class":804}," distinctId",[615,2687,928],{"class":625},[615,2689,639],{"class":625},[615,2691,2692],{"class":642},"checkout-worker",[615,2694,807],{"class":625},[615,2696,633],{"class":625},[615,2698,829],{"class":629},[2070,2700,2701],{"color":2072,"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.",[651,2703,2705],{"id":2704},"logs-vs-events","Logs vs Events",[1335,2707,2708,2722],{},[1338,2709,2710],{},[1341,2711,2712,2714,2718],{},[1344,2713],{},[1344,2715,2716],{},[612,2717,1310],{},[1344,2719,2720],{},[612,2721,2326],{},[1351,2723,2724,2742,2755,2768],{},[1341,2725,2726,2730,2736],{},[1356,2727,2728],{},[669,2729,1724],{},[1356,2731,2732,2733,685],{},"OTLP Logs (",[612,2734,2735],{},"\u002Fi\u002Fv1\u002Flogs",[1356,2737,2738,2739,685],{},"PostHog Events (",[612,2740,2741],{},"\u002Fbatch\u002F",[1341,2743,2744,2749,2752],{},[1356,2745,2746],{},[669,2747,2748],{},"PostHog UI",[1356,2750,2751],{},"Logs viewer",[1356,2753,2754],{},"Events explorer",[1341,2756,2757,2762,2765],{},[1356,2758,2759],{},[669,2760,2761],{},"Cost",[1356,2763,2764],{},"Lower (dedicated logs pipeline)",[1356,2766,2767],{},"Higher (counts as events)",[1341,2769,2770,2775,2778],{},[1356,2771,2772],{},[669,2773,2774],{},"Best for",[1356,2776,2777],{},"Debugging, log search, observability",[1356,2779,2780],{},"Product analytics, cohorts, funnels",[536,2782,2783],{},"You can use both drains simultaneously to get the best of both worlds:",[604,2785,2787],{"className":606,"code":2786,"filename":1477,"language":609,"meta":610,"style":610},"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",[612,2788,2789,2807,2811,2825,2854,2858,2880,2918],{"__ignoreMap":610},[615,2790,2791,2793,2795,2797,2799,2801,2803,2805],{"class":617,"line":618},[615,2792,622],{"class":621},[615,2794,626],{"class":625},[615,2796,630],{"class":629},[615,2798,633],{"class":625},[615,2800,636],{"class":621},[615,2802,639],{"class":625},[615,2804,643],{"class":642},[615,2806,646],{"class":625},[615,2808,2809],{"class":617,"line":730},[615,2810,753],{"emptyLinePlaceholder":752},[615,2812,2813,2815,2818,2820,2822],{"class":617,"line":749},[615,2814,1484],{"class":780},[615,2816,2817],{"class":629}," logs ",[615,2819,705],{"class":625},[615,2821,630],{"class":765},[615,2823,2824],{"class":629},"()\n",[615,2826,2827,2829,2832,2834,2836,2838,2840,2842,2844,2846,2848,2850,2852],{"class":617,"line":756},[615,2828,1484],{"class":780},[615,2830,2831],{"class":629}," events ",[615,2833,705],{"class":625},[615,2835,630],{"class":765},[615,2837,769],{"class":629},[615,2839,1007],{"class":625},[615,2841,2634],{"class":804},[615,2843,928],{"class":625},[615,2845,639],{"class":625},[615,2847,2252],{"class":642},[615,2849,807],{"class":625},[615,2851,633],{"class":625},[615,2853,829],{"class":629},[615,2855,2856],{"class":617,"line":787},[615,2857,753],{"emptyLinePlaceholder":752},[615,2859,2860,2862,2864,2866,2869,2871,2874,2876,2878],{"class":617,"line":823},[615,2861,1484],{"class":780},[615,2863,1487],{"class":629},[615,2865,705],{"class":625},[615,2867,2868],{"class":780}," async",[615,2870,1326],{"class":625},[615,2872,2873],{"class":774},"ctx",[615,2875,685],{"class":625},[615,2877,781],{"class":780},[615,2879,784],{"class":625},[615,2881,2882,2885,2889,2891,2894,2897,2900,2902,2904,2906,2908,2911,2913,2915],{"class":617,"line":941},[615,2883,2884],{"class":621},"  await",[615,2886,2888],{"class":2887},"sBMFI"," Promise",[615,2890,793],{"class":625},[615,2892,2893],{"class":765},"allSettled",[615,2895,2896],{"class":804},"([",[615,2898,2899],{"class":765},"logs",[615,2901,769],{"class":804},[615,2903,2873],{"class":629},[615,2905,685],{"class":804},[615,2907,815],{"class":625},[615,2909,2910],{"class":765}," events",[615,2912,769],{"class":804},[615,2914,2873],{"class":629},[615,2916,2917],{"class":804},")])\n",[615,2919,2920],{"class":617,"line":956},[615,2921,2922],{"class":625},"}\n",[597,2924,2926],{"id":2925},"troubleshooting","Troubleshooting",[651,2928,2930],{"id":2929},"missing-apikey-error","Missing apiKey error",[604,2932,2938],{"className":2933,"code":2935,"filename":2936,"language":2937,"meta":610},[2934],"language-text","[evlog\u002Fposthog] Missing apiKey. Set POSTHOG_API_KEY env var or pass to createPostHogDrain()\n","Console","text",[612,2939,2935],{"__ignoreMap":610},[536,2941,2942],{},"Make sure your environment variable is set and the server was restarted after adding it.",[651,2944,2946],{"id":2945},"events-not-appearing","Events not appearing",[536,2948,2949],{},"PostHog processes events asynchronously. There may be a short delay (typically under 1 minute) before events appear in the dashboard.",[560,2951,2952,2959,2964],{},[563,2953,2954,2955,2958],{},"Check the server console for ",[612,2956,2957],{},"[evlog\u002Fposthog]"," error messages",[563,2960,2961,2962],{},"Verify your API key is correct and starts with ",[612,2963,684],{},[563,2965,2966,2967,2969],{},"Confirm your ",[612,2968,1578],{}," matches your PostHog region (US vs EU)",[651,2971,2973],{"id":2972},"wrong-region","Wrong region",[536,2975,2976,2977,2979],{},"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 ",[612,2978,2957],{},") to your server console. Set the correct host:",[604,2981,2983],{"className":692,"code":2982,"filename":694,"language":695,"meta":610,"style":610},"POSTHOG_HOST=https:\u002F\u002Feu.i.posthog.com\n",[612,2984,2985],{"__ignoreMap":610},[615,2986,2987,2989,2991],{"class":617,"line":618},[615,2988,1371],{"class":629},[615,2990,705],{"class":625},[615,2992,2163],{"class":642},[597,2994,2996],{"id":2995},"direct-api-usage","Direct API Usage",[536,2998,2999],{},"For advanced use cases, you can use the lower-level functions:",[604,3001,3004],{"className":606,"code":3002,"filename":3003,"language":609,"meta":610,"style":610},"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",[612,3005,3006,3030,3034,3039,3052,3068,3074,3078,3083,3097,3112],{"__ignoreMap":610},[615,3007,3008,3010,3012,3015,3017,3020,3022,3024,3026,3028],{"class":617,"line":618},[615,3009,622],{"class":621},[615,3011,626],{"class":625},[615,3013,3014],{"class":629}," sendToPostHog",[615,3016,815],{"class":625},[615,3018,3019],{"class":629}," sendBatchToPostHog",[615,3021,633],{"class":625},[615,3023,636],{"class":621},[615,3025,639],{"class":625},[615,3027,643],{"class":642},[615,3029,646],{"class":625},[615,3031,3032],{"class":617,"line":730},[615,3033,753],{"emptyLinePlaceholder":752},[615,3035,3036],{"class":617,"line":749},[615,3037,3038],{"class":726},"\u002F\u002F Send a single event to PostHog Logs (OTLP)\n",[615,3040,3041,3043,3045,3048,3050],{"class":617,"line":756},[615,3042,1108],{"class":621},[615,3044,3014],{"class":765},[615,3046,3047],{"class":629},"(event",[615,3049,815],{"class":625},[615,3051,784],{"class":625},[615,3053,3054,3057,3059,3061,3064,3066],{"class":617,"line":787},[615,3055,3056],{"class":804},"  apiKey",[615,3058,928],{"class":625},[615,3060,639],{"class":625},[615,3062,3063],{"class":642},"phc_xxx",[615,3065,807],{"class":625},[615,3067,938],{"class":625},[615,3069,3070,3072],{"class":617,"line":823},[615,3071,826],{"class":625},[615,3073,829],{"class":629},[615,3075,3076],{"class":617,"line":941},[615,3077,753],{"emptyLinePlaceholder":752},[615,3079,3080],{"class":617,"line":956},[615,3081,3082],{"class":726},"\u002F\u002F Send multiple events in one request\n",[615,3084,3086,3088,3090,3093,3095],{"class":617,"line":3085},9,[615,3087,1108],{"class":621},[615,3089,3019],{"class":765},[615,3091,3092],{"class":629},"(events",[615,3094,815],{"class":625},[615,3096,784],{"class":625},[615,3098,3100,3102,3104,3106,3108,3110],{"class":617,"line":3099},10,[615,3101,3056],{"class":804},[615,3103,928],{"class":625},[615,3105,639],{"class":625},[615,3107,3063],{"class":642},[615,3109,807],{"class":625},[615,3111,938],{"class":625},[615,3113,3115,3117],{"class":617,"line":3114},11,[615,3116,826],{"class":625},[615,3118,829],{"class":629},[536,3120,3121],{},"For custom events, use the events-specific functions:",[604,3123,3125],{"className":606,"code":3124,"filename":3003,"language":609,"meta":610,"style":610},"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",[612,3126,3127,3156,3160,3165,3177,3191,3197,3201,3206,3218,3232,3238,3243,3249],{"__ignoreMap":610},[615,3128,3129,3131,3133,3136,3138,3141,3143,3146,3148,3150,3152,3154],{"class":617,"line":618},[615,3130,622],{"class":621},[615,3132,626],{"class":625},[615,3134,3135],{"class":629}," sendToPostHogEvents",[615,3137,815],{"class":625},[615,3139,3140],{"class":629}," sendBatchToPostHogEvents",[615,3142,815],{"class":625},[615,3144,3145],{"class":629}," toPostHogEvent",[615,3147,633],{"class":625},[615,3149,636],{"class":621},[615,3151,639],{"class":625},[615,3153,643],{"class":642},[615,3155,646],{"class":625},[615,3157,3158],{"class":617,"line":730},[615,3159,753],{"emptyLinePlaceholder":752},[615,3161,3162],{"class":617,"line":749},[615,3163,3164],{"class":726},"\u002F\u002F Send a single custom event\n",[615,3166,3167,3169,3171,3173,3175],{"class":617,"line":756},[615,3168,1108],{"class":621},[615,3170,3135],{"class":765},[615,3172,3047],{"class":629},[615,3174,815],{"class":625},[615,3176,784],{"class":625},[615,3178,3179,3181,3183,3185,3187,3189],{"class":617,"line":787},[615,3180,3056],{"class":804},[615,3182,928],{"class":625},[615,3184,639],{"class":625},[615,3186,3063],{"class":642},[615,3188,807],{"class":625},[615,3190,938],{"class":625},[615,3192,3193,3195],{"class":617,"line":823},[615,3194,826],{"class":625},[615,3196,829],{"class":629},[615,3198,3199],{"class":617,"line":941},[615,3200,753],{"emptyLinePlaceholder":752},[615,3202,3203],{"class":617,"line":956},[615,3204,3205],{"class":726},"\u002F\u002F Send multiple custom events in one request\n",[615,3207,3208,3210,3212,3214,3216],{"class":617,"line":3085},[615,3209,1108],{"class":621},[615,3211,3140],{"class":765},[615,3213,3092],{"class":629},[615,3215,815],{"class":625},[615,3217,784],{"class":625},[615,3219,3220,3222,3224,3226,3228,3230],{"class":617,"line":3099},[615,3221,3056],{"class":804},[615,3223,928],{"class":625},[615,3225,639],{"class":625},[615,3227,3063],{"class":642},[615,3229,807],{"class":625},[615,3231,938],{"class":625},[615,3233,3234,3236],{"class":617,"line":3114},[615,3235,826],{"class":625},[615,3237,829],{"class":629},[615,3239,3241],{"class":617,"line":3240},12,[615,3242,753],{"emptyLinePlaceholder":752},[615,3244,3246],{"class":617,"line":3245},13,[615,3247,3248],{"class":726},"\u002F\u002F Convert event to PostHog format (for inspection)\n",[615,3250,3252,3254,3257,3259,3261,3263,3265,3267,3270,3272,3274,3276,3278,3280],{"class":617,"line":3251},14,[615,3253,1484],{"class":780},[615,3255,3256],{"class":629}," posthogEvent ",[615,3258,705],{"class":625},[615,3260,3145],{"class":765},[615,3262,3047],{"class":629},[615,3264,815],{"class":625},[615,3266,626],{"class":625},[615,3268,3269],{"class":804}," apiKey",[615,3271,928],{"class":625},[615,3273,639],{"class":625},[615,3275,3063],{"class":642},[615,3277,807],{"class":625},[615,3279,633],{"class":625},[615,3281,829],{"class":629},[597,3283,3285],{"id":3284},"next-steps","Next Steps",[1699,3287,3288,3294,3300,3306],{},[563,3289,3290,3293],{},[539,3291,3292],{"href":152},"Axiom Adapter"," - Send logs to Axiom",[563,3295,3296,3299],{},[539,3297,3298],{"href":192},"OTLP Adapter"," - Send logs via OpenTelemetry Protocol",[563,3301,3302,3305],{},[539,3303,3304],{"href":491},"Custom Adapters"," - Build your own adapter",[563,3307,3308,3310],{},[539,3309,517],{"href":518}," - Security and production tips",[3312,3313,3314],"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":610,"searchDepth":730,"depth":730,"links":3316},[3317,3318,3323,3329,3330,3333,3334,3335,3342,3347,3348],{"id":599,"depth":730,"text":20},{"id":649,"depth":730,"text":25,"children":3319},[3320,3321,3322],{"id":653,"depth":749,"text":654},{"id":688,"depth":749,"text":689},{"id":711,"depth":749,"text":712},{"id":1296,"depth":730,"text":504,"children":3324},[3325,3326,3327,3328],{"id":1332,"depth":749,"text":1333},{"id":1377,"depth":749,"text":1378},{"id":1469,"depth":749,"text":1470},{"id":1533,"depth":749,"text":1534},{"id":1686,"depth":730,"text":1687},{"id":1744,"depth":730,"text":1745,"children":3331},[3332],{"id":1958,"depth":749,"text":1959},{"id":2088,"depth":730,"text":2089},{"id":2166,"depth":730,"text":2167},{"id":2189,"depth":730,"text":2190,"children":3336},[3337,3338,3339,3340,3341],{"id":2330,"depth":749,"text":2331},{"id":2453,"depth":749,"text":2454},{"id":2548,"depth":749,"text":2549},{"id":2588,"depth":749,"text":2589},{"id":2704,"depth":749,"text":2705},{"id":2925,"depth":730,"text":2926,"children":3343},[3344,3345,3346],{"id":2929,"depth":749,"text":2930},{"id":2945,"depth":749,"text":2946},{"id":2972,"depth":749,"text":2973},{"id":2995,"depth":730,"text":2996},{"id":3284,"depth":730,"text":3285},"Send wide events to PostHog Logs via OTLP for structured log querying, debugging, and observability in your PostHog dashboard.","md",[3352,3358],{"label":3353,"icon":3354,"to":662,"target":3355,"color":3356,"variant":3357},"PostHog Dashboard","i-lucide-external-link","_blank","neutral","subtle",{"label":3292,"icon":154,"to":152,"color":3356,"variant":3357},{},{"title":156,"icon":159},{"title":531,"description":3349},"dTVeoANNa26ZxNLBhLYUBpdh8M6tUgIxAcbtWUtylVI",[3364,3366],{"title":151,"path":152,"stem":153,"description":3365,"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":3367,"icon":164,"children":-1},"Send structured logs to Sentry Logs for high-cardinality querying and debugging. Zero-config setup with environment variables.",1786402500994]