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