[{"data":1,"prerenderedAt":4107},["ShallowReactive",2],{"navigation_docs":3,"-integrate-adapters-cloud-posthog":602,"-integrate-adapters-cloud-posthog-surround":4102},[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":4088,"extension":4089,"links":4090,"meta":4098,"navigation":4099,"path":167,"seo":4100,"stem":168,"__hash__":4101},"docs\u002F4.integrate\u002Fadapters\u002Fcloud\u002F02.posthog.md","PostHog Adapter",{"type":606,"value":607,"toc":4053},"minimark",[608,624,669,673,676,720,723,728,759,763,782,786,1881,1884,1887,1890,1920,1924,1965,1969,1976,2059,2063,2066,2121,2125,2298,2302,2312,2356,2360,2375,2388,2422,2425,2435,2439,2446,2455,2538,2545,2649,2653,2656,2713,2720,2756,2762,2777,2781,2787,2827,2855,2859,2865,2878,2882,2891,2986,2997,3003,3019,3023,3165,3169,3172,3260,3287,3291,3297,3327,3331,3338,3348,3439,3442,3446,3520,3523,3661,3665,3669,3678,3681,3685,3688,3708,3712,3718,3731,3735,3738,3857,3860,4020,4024,4049],[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,896,974,1101,1190,1289,1393,1452,1506,1565,1619,1673,1759,1833],"framework-tabs",{},[677,790,793],{"className":679,"code":791,"filename":240,"language":682,"meta":792,"style":683},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\nexport default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook('evlog:drain', createPostHogDrain())\n})\n","server\u002Fplugins\u002Fevlog-drain.ts",[685,794,795,813,820,851,887],{"__ignoreMap":683},[688,796,797,799,801,803,805,807,809,811],{"class":690,"line":691},[688,798,695],{"class":694},[688,800,699],{"class":698},[688,802,703],{"class":702},[688,804,706],{"class":698},[688,806,709],{"class":694},[688,808,712],{"class":698},[688,810,716],{"class":715},[688,812,719],{"class":698},[688,814,816],{"class":690,"line":815},2,[688,817,819],{"emptyLinePlaceholder":818},true,"\n",[688,821,823,826,829,833,836,838,842,844,848],{"class":690,"line":822},3,[688,824,825],{"class":694},"export",[688,827,828],{"class":694}," default",[688,830,832],{"class":831},"s2Zo4"," defineNitroPlugin",[688,834,835],{"class":702},"(",[688,837,835],{"class":698},[688,839,841],{"class":840},"sHdIc","nitroApp",[688,843,758],{"class":698},[688,845,847],{"class":846},"spNyl"," =>",[688,849,850],{"class":698}," {\n",[688,852,854,857,860,863,865,868,871,874,877,879,882,884],{"class":690,"line":853},4,[688,855,856],{"class":702},"  nitroApp",[688,858,859],{"class":698},".",[688,861,862],{"class":702},"hooks",[688,864,859],{"class":698},[688,866,867],{"class":831},"hook",[688,869,835],{"class":870},"swJcz",[688,872,873],{"class":698},"'",[688,875,876],{"class":715},"evlog:drain",[688,878,873],{"class":698},[688,880,881],{"class":698},",",[688,883,703],{"class":831},[688,885,886],{"class":870},"())\n",[688,888,890,893],{"class":690,"line":889},5,[688,891,892],{"class":698},"}",[688,894,895],{"class":702},")\n",[677,897,898],{"className":679,"code":791,"filename":255,"language":682,"meta":792,"style":683},[685,899,900,918,922,942,968],{"__ignoreMap":683},[688,901,902,904,906,908,910,912,914,916],{"class":690,"line":691},[688,903,695],{"class":694},[688,905,699],{"class":698},[688,907,703],{"class":702},[688,909,706],{"class":698},[688,911,709],{"class":694},[688,913,712],{"class":698},[688,915,716],{"class":715},[688,917,719],{"class":698},[688,919,920],{"class":690,"line":815},[688,921,819],{"emptyLinePlaceholder":818},[688,923,924,926,928,930,932,934,936,938,940],{"class":690,"line":822},[688,925,825],{"class":694},[688,927,828],{"class":694},[688,929,832],{"class":831},[688,931,835],{"class":702},[688,933,835],{"class":698},[688,935,841],{"class":840},[688,937,758],{"class":698},[688,939,847],{"class":846},[688,941,850],{"class":698},[688,943,944,946,948,950,952,954,956,958,960,962,964,966],{"class":690,"line":853},[688,945,856],{"class":702},[688,947,859],{"class":698},[688,949,862],{"class":702},[688,951,859],{"class":698},[688,953,867],{"class":831},[688,955,835],{"class":870},[688,957,873],{"class":698},[688,959,876],{"class":715},[688,961,873],{"class":698},[688,963,881],{"class":698},[688,965,703],{"class":831},[688,967,886],{"class":870},[688,969,970,972],{"class":690,"line":889},[688,971,892],{"class":698},[688,973,895],{"class":702},[677,975,978],{"className":679,"code":976,"filename":245,"language":682,"meta":977,"style":683},"import { 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","lib\u002Fevlog.ts",[685,979,980,1000,1018,1022,1061,1079,1094],{"__ignoreMap":683},[688,981,982,984,986,989,991,993,995,998],{"class":690,"line":691},[688,983,695],{"class":694},[688,985,699],{"class":698},[688,987,988],{"class":702}," createEvlog",[688,990,706],{"class":698},[688,992,709],{"class":694},[688,994,712],{"class":698},[688,996,997],{"class":715},"evlog\u002Fnext",[688,999,719],{"class":698},[688,1001,1002,1004,1006,1008,1010,1012,1014,1016],{"class":690,"line":815},[688,1003,695],{"class":694},[688,1005,699],{"class":698},[688,1007,703],{"class":702},[688,1009,706],{"class":698},[688,1011,709],{"class":694},[688,1013,712],{"class":698},[688,1015,716],{"class":715},[688,1017,719],{"class":698},[688,1019,1020],{"class":690,"line":822},[688,1021,819],{"emptyLinePlaceholder":818},[688,1023,1024,1026,1029,1031,1034,1036,1039,1041,1044,1046,1049,1051,1054,1056,1058],{"class":690,"line":853},[688,1025,825],{"class":694},[688,1027,1028],{"class":846}," const",[688,1030,699],{"class":698},[688,1032,1033],{"class":702}," withEvlog",[688,1035,881],{"class":698},[688,1037,1038],{"class":702}," useLogger",[688,1040,881],{"class":698},[688,1042,1043],{"class":702}," log",[688,1045,881],{"class":698},[688,1047,1048],{"class":702}," createError ",[688,1050,892],{"class":698},[688,1052,1053],{"class":698}," =",[688,1055,988],{"class":831},[688,1057,835],{"class":702},[688,1059,1060],{"class":698},"{\n",[688,1062,1063,1066,1069,1071,1074,1076],{"class":690,"line":889},[688,1064,1065],{"class":870},"  service",[688,1067,1068],{"class":698},":",[688,1070,712],{"class":698},[688,1072,1073],{"class":715},"my-app",[688,1075,873],{"class":698},[688,1077,1078],{"class":698},",\n",[688,1080,1082,1085,1087,1089,1092],{"class":690,"line":1081},6,[688,1083,1084],{"class":870},"  drain",[688,1086,1068],{"class":698},[688,1088,703],{"class":831},[688,1090,1091],{"class":702},"()",[688,1093,1078],{"class":698},[688,1095,1097,1099],{"class":690,"line":1096},7,[688,1098,892],{"class":698},[688,1100,895],{"class":702},[677,1102,1105],{"className":679,"code":1103,"filename":250,"language":682,"meta":1104,"style":683},"import { createEvlogHooks } from 'evlog\u002Fsveltekit'\nimport { createPostHogDrain } from 'evlog\u002Fposthog'\n\nexport const { handle, handleError } = createEvlogHooks({ drain: createPostHogDrain() })\n","src\u002Fhooks.server.ts",[685,1106,1107,1127,1145,1149],{"__ignoreMap":683},[688,1108,1109,1111,1113,1116,1118,1120,1122,1125],{"class":690,"line":691},[688,1110,695],{"class":694},[688,1112,699],{"class":698},[688,1114,1115],{"class":702}," createEvlogHooks",[688,1117,706],{"class":698},[688,1119,709],{"class":694},[688,1121,712],{"class":698},[688,1123,1124],{"class":715},"evlog\u002Fsveltekit",[688,1126,719],{"class":698},[688,1128,1129,1131,1133,1135,1137,1139,1141,1143],{"class":690,"line":815},[688,1130,695],{"class":694},[688,1132,699],{"class":698},[688,1134,703],{"class":702},[688,1136,706],{"class":698},[688,1138,709],{"class":694},[688,1140,712],{"class":698},[688,1142,716],{"class":715},[688,1144,719],{"class":698},[688,1146,1147],{"class":690,"line":822},[688,1148,819],{"emptyLinePlaceholder":818},[688,1150,1151,1153,1155,1157,1160,1162,1165,1167,1169,1171,1173,1176,1179,1181,1183,1186,1188],{"class":690,"line":853},[688,1152,825],{"class":694},[688,1154,1028],{"class":846},[688,1156,699],{"class":698},[688,1158,1159],{"class":702}," handle",[688,1161,881],{"class":698},[688,1163,1164],{"class":702}," handleError ",[688,1166,892],{"class":698},[688,1168,1053],{"class":698},[688,1170,1115],{"class":831},[688,1172,835],{"class":702},[688,1174,1175],{"class":698},"{",[688,1177,1178],{"class":870}," drain",[688,1180,1068],{"class":698},[688,1182,703],{"class":831},[688,1184,1185],{"class":702},"() ",[688,1187,892],{"class":698},[688,1189,895],{"class":702},[677,1191,1193],{"className":679,"code":1192,"filename":260,"language":682,"meta":792,"style":683},"import { definePlugin } from 'nitro'\nimport { createPostHogDrain } from 'evlog\u002Fposthog'\n\nexport default definePlugin((nitroApp) => {\n  nitroApp.hooks.hook('evlog:drain', createPostHogDrain())\n})\n",[685,1194,1195,1215,1233,1237,1257,1283],{"__ignoreMap":683},[688,1196,1197,1199,1201,1204,1206,1208,1210,1213],{"class":690,"line":691},[688,1198,695],{"class":694},[688,1200,699],{"class":698},[688,1202,1203],{"class":702}," definePlugin",[688,1205,706],{"class":698},[688,1207,709],{"class":694},[688,1209,712],{"class":698},[688,1211,1212],{"class":715},"nitro",[688,1214,719],{"class":698},[688,1216,1217,1219,1221,1223,1225,1227,1229,1231],{"class":690,"line":815},[688,1218,695],{"class":694},[688,1220,699],{"class":698},[688,1222,703],{"class":702},[688,1224,706],{"class":698},[688,1226,709],{"class":694},[688,1228,712],{"class":698},[688,1230,716],{"class":715},[688,1232,719],{"class":698},[688,1234,1235],{"class":690,"line":822},[688,1236,819],{"emptyLinePlaceholder":818},[688,1238,1239,1241,1243,1245,1247,1249,1251,1253,1255],{"class":690,"line":853},[688,1240,825],{"class":694},[688,1242,828],{"class":694},[688,1244,1203],{"class":831},[688,1246,835],{"class":702},[688,1248,835],{"class":698},[688,1250,841],{"class":840},[688,1252,758],{"class":698},[688,1254,847],{"class":846},[688,1256,850],{"class":698},[688,1258,1259,1261,1263,1265,1267,1269,1271,1273,1275,1277,1279,1281],{"class":690,"line":889},[688,1260,856],{"class":702},[688,1262,859],{"class":698},[688,1264,862],{"class":702},[688,1266,859],{"class":698},[688,1268,867],{"class":831},[688,1270,835],{"class":870},[688,1272,873],{"class":698},[688,1274,876],{"class":715},[688,1276,873],{"class":698},[688,1278,881],{"class":698},[688,1280,703],{"class":831},[688,1282,886],{"class":870},[688,1284,1285,1287],{"class":690,"line":1081},[688,1286,892],{"class":698},[688,1288,895],{"class":702},[677,1290,1293],{"className":679,"code":1291,"filename":290,"language":682,"meta":1292,"style":683},"import { evlog } from 'evlog\u002Freact-router'\nimport { createPostHogDrain } from 'evlog\u002Fposthog'\n\nexport const middleware: Route.MiddlewareFunction[] = [\n  evlog({ drain: createPostHogDrain() }),\n]\n","app\u002Froot.tsx",[685,1294,1295,1315,1333,1337,1365,1388],{"__ignoreMap":683},[688,1296,1297,1299,1301,1304,1306,1308,1310,1313],{"class":690,"line":691},[688,1298,695],{"class":694},[688,1300,699],{"class":698},[688,1302,1303],{"class":702}," evlog",[688,1305,706],{"class":698},[688,1307,709],{"class":694},[688,1309,712],{"class":698},[688,1311,1312],{"class":715},"evlog\u002Freact-router",[688,1314,719],{"class":698},[688,1316,1317,1319,1321,1323,1325,1327,1329,1331],{"class":690,"line":815},[688,1318,695],{"class":694},[688,1320,699],{"class":698},[688,1322,703],{"class":702},[688,1324,706],{"class":698},[688,1326,709],{"class":694},[688,1328,712],{"class":698},[688,1330,716],{"class":715},[688,1332,719],{"class":698},[688,1334,1335],{"class":690,"line":822},[688,1336,819],{"emptyLinePlaceholder":818},[688,1338,1339,1341,1343,1346,1348,1352,1354,1357,1360,1362],{"class":690,"line":853},[688,1340,825],{"class":694},[688,1342,1028],{"class":846},[688,1344,1345],{"class":702}," middleware",[688,1347,1068],{"class":698},[688,1349,1351],{"class":1350},"sBMFI"," Route",[688,1353,859],{"class":698},[688,1355,1356],{"class":1350},"MiddlewareFunction",[688,1358,1359],{"class":702},"[] ",[688,1361,778],{"class":698},[688,1363,1364],{"class":702}," [\n",[688,1366,1367,1370,1372,1374,1376,1378,1380,1382,1384,1386],{"class":690,"line":889},[688,1368,1369],{"class":831},"  evlog",[688,1371,835],{"class":702},[688,1373,1175],{"class":698},[688,1375,1178],{"class":870},[688,1377,1068],{"class":698},[688,1379,703],{"class":831},[688,1381,1185],{"class":702},[688,1383,892],{"class":698},[688,1385,758],{"class":702},[688,1387,1078],{"class":698},[688,1389,1390],{"class":690,"line":1081},[688,1391,1392],{"class":702},"]\n",[677,1394,1396],{"className":679,"code":1395,"filename":275,"language":682,"meta":681,"style":683},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\napp.use(evlog({ drain: createPostHogDrain() }))\n",[685,1397,1398,1416,1420],{"__ignoreMap":683},[688,1399,1400,1402,1404,1406,1408,1410,1412,1414],{"class":690,"line":691},[688,1401,695],{"class":694},[688,1403,699],{"class":698},[688,1405,703],{"class":702},[688,1407,706],{"class":698},[688,1409,709],{"class":694},[688,1411,712],{"class":698},[688,1413,716],{"class":715},[688,1415,719],{"class":698},[688,1417,1418],{"class":690,"line":815},[688,1419,819],{"emptyLinePlaceholder":818},[688,1421,1422,1425,1427,1430,1432,1435,1437,1439,1441,1443,1445,1447,1449],{"class":690,"line":822},[688,1423,1424],{"class":702},"app",[688,1426,859],{"class":698},[688,1428,1429],{"class":831},"use",[688,1431,835],{"class":702},[688,1433,1434],{"class":831},"evlog",[688,1436,835],{"class":702},[688,1438,1175],{"class":698},[688,1440,1178],{"class":870},[688,1442,1068],{"class":698},[688,1444,703],{"class":831},[688,1446,1185],{"class":702},[688,1448,892],{"class":698},[688,1450,1451],{"class":702},"))\n",[677,1453,1454],{"className":679,"code":1395,"filename":270,"language":682,"meta":681,"style":683},[685,1455,1456,1474,1478],{"__ignoreMap":683},[688,1457,1458,1460,1462,1464,1466,1468,1470,1472],{"class":690,"line":691},[688,1459,695],{"class":694},[688,1461,699],{"class":698},[688,1463,703],{"class":702},[688,1465,706],{"class":698},[688,1467,709],{"class":694},[688,1469,712],{"class":698},[688,1471,716],{"class":715},[688,1473,719],{"class":698},[688,1475,1476],{"class":690,"line":815},[688,1477,819],{"emptyLinePlaceholder":818},[688,1479,1480,1482,1484,1486,1488,1490,1492,1494,1496,1498,1500,1502,1504],{"class":690,"line":822},[688,1481,1424],{"class":702},[688,1483,859],{"class":698},[688,1485,1429],{"class":831},[688,1487,835],{"class":702},[688,1489,1434],{"class":831},[688,1491,835],{"class":702},[688,1493,1175],{"class":698},[688,1495,1178],{"class":870},[688,1497,1068],{"class":698},[688,1499,703],{"class":831},[688,1501,1185],{"class":702},[688,1503,892],{"class":698},[688,1505,1451],{"class":702},[677,1507,1509],{"className":679,"code":1508,"filename":280,"language":682,"meta":681,"style":683},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\nawait app.register(evlog, { drain: createPostHogDrain() })\n",[685,1510,1511,1529,1533],{"__ignoreMap":683},[688,1512,1513,1515,1517,1519,1521,1523,1525,1527],{"class":690,"line":691},[688,1514,695],{"class":694},[688,1516,699],{"class":698},[688,1518,703],{"class":702},[688,1520,706],{"class":698},[688,1522,709],{"class":694},[688,1524,712],{"class":698},[688,1526,716],{"class":715},[688,1528,719],{"class":698},[688,1530,1531],{"class":690,"line":815},[688,1532,819],{"emptyLinePlaceholder":818},[688,1534,1535,1538,1541,1543,1546,1549,1551,1553,1555,1557,1559,1561,1563],{"class":690,"line":822},[688,1536,1537],{"class":694},"await",[688,1539,1540],{"class":702}," app",[688,1542,859],{"class":698},[688,1544,1545],{"class":831},"register",[688,1547,1548],{"class":702},"(evlog",[688,1550,881],{"class":698},[688,1552,699],{"class":698},[688,1554,1178],{"class":870},[688,1556,1068],{"class":698},[688,1558,703],{"class":831},[688,1560,1185],{"class":702},[688,1562,892],{"class":698},[688,1564,895],{"class":702},[677,1566,1567],{"className":679,"code":1395,"filename":285,"language":682,"meta":681,"style":683},[685,1568,1569,1587,1591],{"__ignoreMap":683},[688,1570,1571,1573,1575,1577,1579,1581,1583,1585],{"class":690,"line":691},[688,1572,695],{"class":694},[688,1574,699],{"class":698},[688,1576,703],{"class":702},[688,1578,706],{"class":698},[688,1580,709],{"class":694},[688,1582,712],{"class":698},[688,1584,716],{"class":715},[688,1586,719],{"class":698},[688,1588,1589],{"class":690,"line":815},[688,1590,819],{"emptyLinePlaceholder":818},[688,1592,1593,1595,1597,1599,1601,1603,1605,1607,1609,1611,1613,1615,1617],{"class":690,"line":822},[688,1594,1424],{"class":702},[688,1596,859],{"class":698},[688,1598,1429],{"class":831},[688,1600,835],{"class":702},[688,1602,1434],{"class":831},[688,1604,835],{"class":702},[688,1606,1175],{"class":698},[688,1608,1178],{"class":870},[688,1610,1068],{"class":698},[688,1612,703],{"class":831},[688,1614,1185],{"class":702},[688,1616,892],{"class":698},[688,1618,1451],{"class":702},[677,1620,1623],{"className":679,"code":1621,"filename":265,"language":682,"meta":1622,"style":683},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\nEvlogModule.forRoot({ drain: createPostHogDrain() })\n","src\u002Fapp.module.ts",[685,1624,1625,1643,1647],{"__ignoreMap":683},[688,1626,1627,1629,1631,1633,1635,1637,1639,1641],{"class":690,"line":691},[688,1628,695],{"class":694},[688,1630,699],{"class":698},[688,1632,703],{"class":702},[688,1634,706],{"class":698},[688,1636,709],{"class":694},[688,1638,712],{"class":698},[688,1640,716],{"class":715},[688,1642,719],{"class":698},[688,1644,1645],{"class":690,"line":815},[688,1646,819],{"emptyLinePlaceholder":818},[688,1648,1649,1652,1654,1657,1659,1661,1663,1665,1667,1669,1671],{"class":690,"line":822},[688,1650,1651],{"class":702},"EvlogModule",[688,1653,859],{"class":698},[688,1655,1656],{"class":831},"forRoot",[688,1658,835],{"class":702},[688,1660,1175],{"class":698},[688,1662,1178],{"class":870},[688,1664,1068],{"class":698},[688,1666,703],{"class":831},[688,1668,1185],{"class":702},[688,1670,892],{"class":698},[688,1672,895],{"class":702},[677,1674,1677],{"className":679,"code":1675,"filename":309,"language":682,"meta":1676,"style":683},"import { withEvlog } from 'evlog\u002Forpc'\nimport { createPostHogDrain } from 'evlog\u002Fposthog'\n\nconst handler = withEvlog(new RPCHandler(router), { drain: createPostHogDrain() })\n","server\u002Forpc.ts",[685,1678,1679,1698,1716,1720],{"__ignoreMap":683},[688,1680,1681,1683,1685,1687,1689,1691,1693,1696],{"class":690,"line":691},[688,1682,695],{"class":694},[688,1684,699],{"class":698},[688,1686,1033],{"class":702},[688,1688,706],{"class":698},[688,1690,709],{"class":694},[688,1692,712],{"class":698},[688,1694,1695],{"class":715},"evlog\u002Forpc",[688,1697,719],{"class":698},[688,1699,1700,1702,1704,1706,1708,1710,1712,1714],{"class":690,"line":815},[688,1701,695],{"class":694},[688,1703,699],{"class":698},[688,1705,703],{"class":702},[688,1707,706],{"class":698},[688,1709,709],{"class":694},[688,1711,712],{"class":698},[688,1713,716],{"class":715},[688,1715,719],{"class":698},[688,1717,1718],{"class":690,"line":822},[688,1719,819],{"emptyLinePlaceholder":818},[688,1721,1722,1725,1728,1730,1732,1734,1737,1740,1743,1745,1747,1749,1751,1753,1755,1757],{"class":690,"line":853},[688,1723,1724],{"class":846},"const",[688,1726,1727],{"class":702}," handler ",[688,1729,778],{"class":698},[688,1731,1033],{"class":831},[688,1733,835],{"class":702},[688,1735,1736],{"class":698},"new",[688,1738,1739],{"class":831}," RPCHandler",[688,1741,1742],{"class":702},"(router)",[688,1744,881],{"class":698},[688,1746,699],{"class":698},[688,1748,1178],{"class":870},[688,1750,1068],{"class":698},[688,1752,703],{"class":831},[688,1754,1185],{"class":702},[688,1756,892],{"class":698},[688,1758,895],{"class":702},[677,1760,1763],{"className":679,"code":1761,"filename":295,"language":682,"meta":1762,"style":683},"import { withEvlog } from 'evlog\u002Fworkers'\nimport { createPostHogDrain } from 'evlog\u002Fposthog'\n\nexport default withEvlog(handler, { drain: createPostHogDrain() })\n","src\u002Fworker.ts",[685,1764,1765,1784,1802,1806],{"__ignoreMap":683},[688,1766,1767,1769,1771,1773,1775,1777,1779,1782],{"class":690,"line":691},[688,1768,695],{"class":694},[688,1770,699],{"class":698},[688,1772,1033],{"class":702},[688,1774,706],{"class":698},[688,1776,709],{"class":694},[688,1778,712],{"class":698},[688,1780,1781],{"class":715},"evlog\u002Fworkers",[688,1783,719],{"class":698},[688,1785,1786,1788,1790,1792,1794,1796,1798,1800],{"class":690,"line":815},[688,1787,695],{"class":694},[688,1789,699],{"class":698},[688,1791,703],{"class":702},[688,1793,706],{"class":698},[688,1795,709],{"class":694},[688,1797,712],{"class":698},[688,1799,716],{"class":715},[688,1801,719],{"class":698},[688,1803,1804],{"class":690,"line":822},[688,1805,819],{"emptyLinePlaceholder":818},[688,1807,1808,1810,1812,1814,1817,1819,1821,1823,1825,1827,1829,1831],{"class":690,"line":853},[688,1809,825],{"class":694},[688,1811,828],{"class":694},[688,1813,1033],{"class":831},[688,1815,1816],{"class":702},"(handler",[688,1818,881],{"class":698},[688,1820,699],{"class":698},[688,1822,1178],{"class":870},[688,1824,1068],{"class":698},[688,1826,703],{"class":831},[688,1828,1185],{"class":702},[688,1830,892],{"class":698},[688,1832,895],{"class":702},[677,1834,1836],{"className":679,"code":1835,"filename":300,"language":682,"meta":683,"style":683},"import { createPostHogDrain } from 'evlog\u002Fposthog'\n\ninitLogger({ drain: createPostHogDrain() })\n",[685,1837,1838,1856,1860],{"__ignoreMap":683},[688,1839,1840,1842,1844,1846,1848,1850,1852,1854],{"class":690,"line":691},[688,1841,695],{"class":694},[688,1843,699],{"class":698},[688,1845,703],{"class":702},[688,1847,706],{"class":698},[688,1849,709],{"class":694},[688,1851,712],{"class":698},[688,1853,716],{"class":715},[688,1855,719],{"class":698},[688,1857,1858],{"class":690,"line":815},[688,1859,819],{"emptyLinePlaceholder":818},[688,1861,1862,1865,1867,1869,1871,1873,1875,1877,1879],{"class":690,"line":822},[688,1863,1864],{"class":831},"initLogger",[688,1866,835],{"class":702},[688,1868,1175],{"class":698},[688,1870,1178],{"class":870},[688,1872,1068],{"class":698},[688,1874,703],{"class":831},[688,1876,1185],{"class":702},[688,1878,892],{"class":698},[688,1880,895],{"class":702},[609,1882,1883],{},"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,1885,547],{"id":1886},"configuration",[609,1888,1889],{},"The adapter reads configuration from multiple sources (highest priority first):",[633,1891,1892,1901,1911],{},[636,1893,1894,1897,1898],{},[742,1895,1896],{},"Overrides"," passed to ",[685,1899,1900],{},"createPostHogDrain()",[636,1902,1903,1906,1907,1910],{},[742,1904,1905],{},"Runtime config"," at ",[685,1908,1909],{},"runtimeConfig.posthog"," (Nuxt\u002FNitro only)",[636,1912,1913,1916,1917,758],{},[742,1914,1915],{},"Environment variables"," (",[685,1918,1919],{},"POSTHOG_*",[724,1921,1923],{"id":1922},"environment-variables","Environment Variables",[1925,1926,1927,1940],"table",{},[1928,1929,1930],"thead",{},[1931,1932,1933,1937],"tr",{},[1934,1935,1936],"th",{},"Variable",[1934,1938,1939],{},"Description",[1941,1942,1943,1955],"tbody",{},[1931,1944,1945,1950],{},[1946,1947,1948],"td",{},[685,1949,775],{},[1946,1951,1952,1953,758],{},"Project API key (starts with ",[685,1954,757],{},[1931,1956,1957,1962],{},[1946,1958,1959],{},[685,1960,1961],{},"POSTHOG_HOST",[1946,1963,1964],{},"PostHog host URL (for EU or self-hosted)",[724,1966,1968],{"id":1967},"runtime-config-nuxt-only","Runtime Config (Nuxt only)",[609,1970,1971,1972,1975],{},"Configure via ",[685,1973,1974],{},"nuxt.config.ts"," for type-safe configuration:",[677,1977,1979],{"className":679,"code":1978,"filename":1974,"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,1980,1981,1994,2003,2012,2028,2042,2047,2052],{"__ignoreMap":683},[688,1982,1983,1985,1987,1990,1992],{"class":690,"line":691},[688,1984,825],{"class":694},[688,1986,828],{"class":694},[688,1988,1989],{"class":831}," defineNuxtConfig",[688,1991,835],{"class":702},[688,1993,1060],{"class":698},[688,1995,1996,1999,2001],{"class":690,"line":815},[688,1997,1998],{"class":870},"  runtimeConfig",[688,2000,1068],{"class":698},[688,2002,850],{"class":698},[688,2004,2005,2008,2010],{"class":690,"line":822},[688,2006,2007],{"class":870},"    posthog",[688,2009,1068],{"class":698},[688,2011,850],{"class":698},[688,2013,2014,2017,2019,2022,2024],{"class":690,"line":853},[688,2015,2016],{"class":870},"      apiKey",[688,2018,1068],{"class":698},[688,2020,2021],{"class":698}," ''",[688,2023,881],{"class":698},[688,2025,2027],{"class":2026},"sHwdD"," \u002F\u002F Set via POSTHOG_API_KEY\n",[688,2029,2030,2033,2035,2037,2039],{"class":690,"line":889},[688,2031,2032],{"class":870},"      host",[688,2034,1068],{"class":698},[688,2036,2021],{"class":698},[688,2038,881],{"class":698},[688,2040,2041],{"class":2026}," \u002F\u002F Set via POSTHOG_HOST\n",[688,2043,2044],{"class":690,"line":1081},[688,2045,2046],{"class":698},"    },\n",[688,2048,2049],{"class":690,"line":1096},[688,2050,2051],{"class":698},"  },\n",[688,2053,2055,2057],{"class":690,"line":2054},8,[688,2056,892],{"class":698},[688,2058,895],{"class":702},[724,2060,2062],{"id":2061},"override-options","Override Options",[609,2064,2065],{},"Pass options directly to override any configuration:",[677,2067,2069],{"className":679,"code":2068,"filename":792,"language":682,"meta":683,"style":683},"const drain = createPostHogDrain({\n  host: 'https:\u002F\u002Feu.i.posthog.com',\n  timeout: 10000,\n})\n",[685,2070,2071,2086,2102,2115],{"__ignoreMap":683},[688,2072,2073,2075,2078,2080,2082,2084],{"class":690,"line":691},[688,2074,1724],{"class":846},[688,2076,2077],{"class":702}," drain ",[688,2079,778],{"class":698},[688,2081,703],{"class":831},[688,2083,835],{"class":702},[688,2085,1060],{"class":698},[688,2087,2088,2091,2093,2095,2098,2100],{"class":690,"line":815},[688,2089,2090],{"class":870},"  host",[688,2092,1068],{"class":698},[688,2094,712],{"class":698},[688,2096,2097],{"class":715},"https:\u002F\u002Feu.i.posthog.com",[688,2099,873],{"class":698},[688,2101,1078],{"class":698},[688,2103,2104,2107,2109,2113],{"class":690,"line":822},[688,2105,2106],{"class":870},"  timeout",[688,2108,1068],{"class":698},[688,2110,2112],{"class":2111},"sbssI"," 10000",[688,2114,1078],{"class":698},[688,2116,2117,2119],{"class":690,"line":853},[688,2118,892],{"class":698},[688,2120,895],{"class":702},[724,2122,2124],{"id":2123},"full-configuration-reference","Full Configuration Reference",[1925,2126,2127,2142],{},[1928,2128,2129],{},[1931,2130,2131,2134,2137,2140],{},[1934,2132,2133],{},"Option",[1934,2135,2136],{},"Type",[1934,2138,2139],{},"Default",[1934,2141,1939],{},[1941,2143,2144,2162,2181,2197,2216,2235,2259,2279],{},[1931,2145,2146,2151,2156,2159],{},[1946,2147,2148],{},[685,2149,2150],{},"apiKey",[1946,2152,2153],{},[685,2154,2155],{},"string",[1946,2157,2158],{},"-",[1946,2160,2161],{},"Project API key (required)",[1931,2163,2164,2169,2173,2178],{},[1946,2165,2166],{},[685,2167,2168],{},"host",[1946,2170,2171],{},[685,2172,2155],{},[1946,2174,2175],{},[685,2176,2177],{},"https:\u002F\u002Fus.i.posthog.com",[1946,2179,2180],{},"PostHog host URL",[1931,2182,2183,2188,2192,2194],{},[1946,2184,2185],{},[685,2186,2187],{},"distinctId",[1946,2189,2190],{},[685,2191,2155],{},[1946,2193,2158],{},[1946,2195,2196],{},"Static person identifier for every event",[1931,2198,2199,2204,2208,2213],{},[1946,2200,2201],{},[685,2202,2203],{},"distinctIdField",[1946,2205,2206],{},[685,2207,2155],{},[1946,2209,2210],{},[685,2211,2212],{},"userId",[1946,2214,2215],{},"Event field holding the person identifier (dot path)",[1931,2217,2218,2223,2227,2232],{},[1946,2219,2220],{},[685,2221,2222],{},"sessionIdField",[1946,2224,2225],{},[685,2226,2155],{},[1946,2228,2229],{},[685,2230,2231],{},"sessionId",[1946,2233,2234],{},"Event field holding the PostHog session id (dot path)",[1931,2236,2237,2242,2247,2252],{},[1946,2238,2239],{},[685,2240,2241],{},"recordShape",[1946,2243,2244],{},[685,2245,2246],{},"'json' | 'compact'",[1946,2248,2249],{},[685,2250,2251],{},"'json'",[1946,2253,2254,2255],{},"Log record shape, see ",[612,2256,2258],{"href":2257},"#choose-a-record-shape","below",[1931,2260,2261,2266,2271,2276],{},[1946,2262,2263],{},[685,2264,2265],{},"timeout",[1946,2267,2268],{},[685,2269,2270],{},"number",[1946,2272,2273],{},[685,2274,2275],{},"5000",[1946,2277,2278],{},"Request timeout in milliseconds",[1931,2280,2281,2286,2290,2295],{},[1946,2282,2283],{},[685,2284,2285],{},"retries",[1946,2287,2288],{},[685,2289,2270],{},[1946,2291,2292],{},[685,2293,2294],{},"2",[1946,2296,2297],{},"Retry attempts on transient failures",[670,2299,2301],{"id":2300},"what-happens-between-a-log-and-posthog","What happens between a log and PostHog",[609,2303,2304,2305,2307,2308,2311],{},"Under the hood, ",[685,2306,1900],{}," wraps the OTLP adapter's ",[685,2309,2310],{},"sendBatchToOTLP()"," with PostHog-specific defaults:",[2313,2314,2315,2325,2334,2344],"ul",{},[636,2316,2317,2320,2321,2324],{},[742,2318,2319],{},"Endpoint",": ",[685,2322,2323],{},"{host}\u002Fi\u002Fv1\u002Flogs"," (PostHog's OTLP log ingest endpoint)",[636,2326,2327,2320,2330,2333],{},[742,2328,2329],{},"Auth",[685,2331,2332],{},"Authorization: Bearer {apiKey}"," header",[636,2335,2336,2339,2340,2343],{},[742,2337,2338],{},"Format",": Standard OTLP ",[685,2341,2342],{},"ExportLogsServiceRequest"," with severity levels, trace context, and structured attributes",[636,2345,2346,2320,2349,2352,2353,2355],{},[742,2347,2348],{},"Identity",[685,2350,2351],{},"posthogDistinctId"," and ",[685,2354,2231],{}," attributes, which is how PostHog joins a log to the rest of your project data",[670,2357,2359],{"id":2358},"choose-a-record-shape","Choose a record shape",[609,2361,2362,2363,2366,2367,2370,2371,2374],{},"PostHog treats log attributes as facets: you filter, break down, and alert on them. With the default ",[685,2364,2365],{},"json"," shape a nested field arrives as one serialized attribute (",[685,2368,2369],{},"ai"," = ",[685,2372,2373],{},"{\"calls\":2,\"costUsd\":0.0012}","), which PostHog can display but not chart.",[609,2376,2377,2380,2381,2352,2384,2387],{},[685,2378,2379],{},"compact"," flattens those into ",[685,2382,2383],{},"ai.calls",[685,2385,2386],{},"ai.costUsd",", and replaces the body with a one-line summary instead of repeating the whole event:",[677,2389,2391],{"className":679,"code":2390,"filename":792,"language":682,"meta":683,"style":683},"const drain = createPostHogDrain({ recordShape: 'compact' })\n",[685,2392,2393],{"__ignoreMap":683},[688,2394,2395,2397,2399,2401,2403,2405,2407,2410,2412,2414,2416,2418,2420],{"class":690,"line":691},[688,2396,1724],{"class":846},[688,2398,2077],{"class":702},[688,2400,778],{"class":698},[688,2402,703],{"class":831},[688,2404,835],{"class":702},[688,2406,1175],{"class":698},[688,2408,2409],{"class":870}," recordShape",[688,2411,1068],{"class":698},[688,2413,712],{"class":698},[688,2415,2379],{"class":715},[688,2417,873],{"class":698},[688,2419,706],{"class":698},[688,2421,895],{"class":702},[609,2423,2424],{},"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.",[2426,2427,2429,2431,2432,2434],"callout",{"color":2428,"icon":13},"info",[685,2430,2379],{}," 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,2433,2365],{}," shape.",[670,2436,2438],{"id":2437},"link-a-log-to-a-person-and-a-session-replay","Link a log to a person and a session replay",[609,2440,2441,2442,2445],{},"A log that carries a person identifier shows up on that person's profile in PostHog, under the ",[742,2443,2444],{},"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,2447,2448,2449,2451,2452,2454],{},"PostHog reads both from log attributes: ",[685,2450,2351],{}," for the person, ",[685,2453,2231],{}," for the replay. The adapter fills them from your wide event, so this works as soon as your event carries the values:",[677,2456,2459],{"className":679,"code":2457,"filename":2458,"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,2460,2461,2475,2479,2493,2513,2532],{"__ignoreMap":683},[688,2462,2463,2465,2468,2470,2472],{"class":690,"line":691},[688,2464,1724],{"class":846},[688,2466,2467],{"class":702}," log ",[688,2469,778],{"class":698},[688,2471,1038],{"class":831},[688,2473,2474],{"class":702},"(event)\n",[688,2476,2477],{"class":690,"line":815},[688,2478,819],{"emptyLinePlaceholder":818},[688,2480,2481,2484,2486,2489,2491],{"class":690,"line":822},[688,2482,2483],{"class":702},"log",[688,2485,859],{"class":698},[688,2487,2488],{"class":831},"set",[688,2490,835],{"class":702},[688,2492,1060],{"class":698},[688,2494,2495,2498,2500,2503,2505,2508,2510],{"class":690,"line":853},[688,2496,2497],{"class":870},"  userId",[688,2499,1068],{"class":698},[688,2501,2502],{"class":702}," user",[688,2504,859],{"class":698},[688,2506,2507],{"class":702},"id",[688,2509,881],{"class":698},[688,2511,2512],{"class":2026}," \u002F\u002F → posthogDistinctId, links to the person\n",[688,2514,2515,2518,2520,2523,2525,2527,2529],{"class":690,"line":889},[688,2516,2517],{"class":870},"  sessionId",[688,2519,1068],{"class":698},[688,2521,2522],{"class":702}," body",[688,2524,859],{"class":698},[688,2526,2231],{"class":702},[688,2528,881],{"class":698},[688,2530,2531],{"class":2026}," \u002F\u002F → sessionId, links to the session replay\n",[688,2533,2534,2536],{"class":690,"line":1081},[688,2535,892],{"class":698},[688,2537,895],{"class":702},[609,2539,2540,2541,2544],{},"The session id comes from the frontend. Read it with ",[685,2542,2543],{},"posthog.get_session_id()"," and send it along with the request:",[677,2546,2549],{"className":679,"code":2547,"filename":2548,"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,2550,2551,2568,2572,2592,2608,2643],{"__ignoreMap":683},[688,2552,2553,2555,2558,2561,2563,2566],{"class":690,"line":691},[688,2554,695],{"class":694},[688,2556,2557],{"class":702}," posthog ",[688,2559,2560],{"class":694},"from",[688,2562,712],{"class":698},[688,2564,2565],{"class":715},"posthog-js",[688,2567,719],{"class":698},[688,2569,2570],{"class":690,"line":815},[688,2571,819],{"emptyLinePlaceholder":818},[688,2573,2574,2576,2579,2581,2583,2586,2588,2590],{"class":690,"line":822},[688,2575,1537],{"class":694},[688,2577,2578],{"class":831}," $fetch",[688,2580,835],{"class":702},[688,2582,873],{"class":698},[688,2584,2585],{"class":715},"\u002Fapi\u002Fcheckout",[688,2587,873],{"class":698},[688,2589,881],{"class":698},[688,2591,850],{"class":698},[688,2593,2594,2597,2599,2601,2604,2606],{"class":690,"line":853},[688,2595,2596],{"class":870},"  method",[688,2598,1068],{"class":698},[688,2600,712],{"class":698},[688,2602,2603],{"class":715},"POST",[688,2605,873],{"class":698},[688,2607,1078],{"class":698},[688,2609,2610,2613,2615,2617,2620,2623,2625,2628,2630,2633,2635,2638,2640],{"class":690,"line":889},[688,2611,2612],{"class":870},"  body",[688,2614,1068],{"class":698},[688,2616,699],{"class":698},[688,2618,2619],{"class":698}," ...",[688,2621,2622],{"class":702},"payload",[688,2624,881],{"class":698},[688,2626,2627],{"class":870}," sessionId",[688,2629,1068],{"class":698},[688,2631,2632],{"class":702}," posthog",[688,2634,859],{"class":698},[688,2636,2637],{"class":831},"get_session_id",[688,2639,1185],{"class":702},[688,2641,2642],{"class":698},"},\n",[688,2644,2645,2647],{"class":690,"line":1081},[688,2646,892],{"class":698},[688,2648,895],{"class":702},[724,2650,2652],{"id":2651},"point-at-your-own-fields","Point at your own fields",[609,2654,2655],{},"When identity lives somewhere else on your events, point the adapter at it. Both options take a dot path:",[677,2657,2659],{"className":679,"code":2658,"filename":792,"language":682,"meta":683,"style":683},"const drain = createPostHogDrain({\n  distinctIdField: 'user.id',\n  sessionIdField: 'session.id',\n})\n",[685,2660,2661,2675,2691,2707],{"__ignoreMap":683},[688,2662,2663,2665,2667,2669,2671,2673],{"class":690,"line":691},[688,2664,1724],{"class":846},[688,2666,2077],{"class":702},[688,2668,778],{"class":698},[688,2670,703],{"class":831},[688,2672,835],{"class":702},[688,2674,1060],{"class":698},[688,2676,2677,2680,2682,2684,2687,2689],{"class":690,"line":815},[688,2678,2679],{"class":870},"  distinctIdField",[688,2681,1068],{"class":698},[688,2683,712],{"class":698},[688,2685,2686],{"class":715},"user.id",[688,2688,873],{"class":698},[688,2690,1078],{"class":698},[688,2692,2693,2696,2698,2700,2703,2705],{"class":690,"line":822},[688,2694,2695],{"class":870},"  sessionIdField",[688,2697,1068],{"class":698},[688,2699,712],{"class":698},[688,2701,2702],{"class":715},"session.id",[688,2704,873],{"class":698},[688,2706,1078],{"class":698},[688,2708,2709,2711],{"class":690,"line":853},[688,2710,892],{"class":698},[688,2712,895],{"class":702},[609,2714,2715,2716,2719],{},"For an ",[612,2717,2718],{"href":446},"eve agent",", the caller principal is the identity eve itself routes on:",[677,2721,2724],{"className":679,"code":2722,"filename":2723,"language":682,"meta":683,"style":683},"const drain = createPostHogDrain({ distinctIdField: 'eve.caller.principalId' })\n","agent\u002Fhooks\u002Fevlog.ts",[685,2725,2726],{"__ignoreMap":683},[688,2727,2728,2730,2732,2734,2736,2738,2740,2743,2745,2747,2750,2752,2754],{"class":690,"line":691},[688,2729,1724],{"class":846},[688,2731,2077],{"class":702},[688,2733,778],{"class":698},[688,2735,703],{"class":831},[688,2737,835],{"class":702},[688,2739,1175],{"class":698},[688,2741,2742],{"class":870}," distinctIdField",[688,2744,1068],{"class":698},[688,2746,712],{"class":698},[688,2748,2749],{"class":715},"eve.caller.principalId",[688,2751,873],{"class":698},[688,2753,706],{"class":698},[688,2755,895],{"class":702},[609,2757,2758,2759,2761],{},"A static ",[685,2760,2187],{}," overrides the field lookup entirely. Use it for a backend that acts as one identity rather than on behalf of users.",[2426,2763,2764,2765,2768,2769,745,2771,2773,2774,2776],{"color":2428,"icon":13},"PostHog matches the attribute value against every ",[685,2766,2767],{},"distinct_id"," it knows for a person, so any one of their identifiers works. The attribute key is configurable per project under ",[742,2770,744],{},[742,2772,2444],{},". Leave it at the default ",[685,2775,2351],{}," and this works out of the box.",[670,2778,2780],{"id":2779},"regions","Regions",[609,2782,2783,2784,2786],{},"PostHog offers US and EU cloud hosting. Set the ",[685,2785,2168],{}," to match your region:",[1925,2788,2789,2799],{},[1928,2790,2791],{},[1931,2792,2793,2796],{},[1934,2794,2795],{},"Region",[1934,2797,2798],{},"Host",[1941,2800,2801,2810,2819],{},[1931,2802,2803,2806],{},[1946,2804,2805],{},"US (default)",[1946,2807,2808],{},[685,2809,2177],{},[1931,2811,2812,2815],{},[1946,2813,2814],{},"EU",[1946,2816,2817],{},[685,2818,2097],{},[1931,2820,2821,2824],{},[1946,2822,2823],{},"Self-hosted",[1946,2825,2826],{},"Your instance URL",[677,2828,2830],{"className":765,"code":2829,"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,2831,2832,2837,2846],{"__ignoreMap":683},[688,2833,2834],{"class":690,"line":691},[688,2835,2836],{"class":2026},"# EU region\n",[688,2838,2839,2841,2843],{"class":690,"line":815},[688,2840,775],{"class":702},[688,2842,778],{"class":698},[688,2844,2845],{"class":715},"phc_xxx\n",[688,2847,2848,2850,2852],{"class":690,"line":822},[688,2849,1961],{"class":702},[688,2851,778],{"class":698},[688,2853,2854],{"class":715},"https:\u002F\u002Feu.i.posthog.com\n",[670,2856,2858],{"id":2857},"query-the-logs-in-posthog","Query the logs in PostHog",[609,2860,2861,2862,2864],{},"Once your logs are flowing, use the ",[742,2863,2444],{}," tab in PostHog to query them:",[633,2866,2867,2872,2875],{},[636,2868,740,2869,2871],{},[742,2870,2444],{}," and filter by service, severity, or any structured attribute",[636,2873,2874],{},"Use the search bar to find specific log entries",[636,2876,2877],{},"Click on a log entry to see all structured attributes",[670,2879,2881],{"id":2880},"send-custom-events-alongside-logs","Send custom events alongside logs",[609,2883,2884,2885,2887,2888,1068],{},"If you prefer sending logs as PostHog custom events (e.g., for product analytics, cohorts, or funnels), use ",[685,2886,1900],{}," with ",[685,2889,2890],{},"mode: 'events'",[677,2892,2894],{"className":679,"code":2893,"filename":792,"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,2895,2896,2914,2918,2932,2948,2964,2980],{"__ignoreMap":683},[688,2897,2898,2900,2902,2904,2906,2908,2910,2912],{"class":690,"line":691},[688,2899,695],{"class":694},[688,2901,699],{"class":698},[688,2903,703],{"class":702},[688,2905,706],{"class":698},[688,2907,709],{"class":694},[688,2909,712],{"class":698},[688,2911,716],{"class":715},[688,2913,719],{"class":698},[688,2915,2916],{"class":690,"line":815},[688,2917,819],{"emptyLinePlaceholder":818},[688,2919,2920,2922,2924,2926,2928,2930],{"class":690,"line":822},[688,2921,1724],{"class":846},[688,2923,2077],{"class":702},[688,2925,778],{"class":698},[688,2927,703],{"class":831},[688,2929,835],{"class":702},[688,2931,1060],{"class":698},[688,2933,2934,2937,2939,2941,2944,2946],{"class":690,"line":853},[688,2935,2936],{"class":870},"  mode",[688,2938,1068],{"class":698},[688,2940,712],{"class":698},[688,2942,2943],{"class":715},"events",[688,2945,873],{"class":698},[688,2947,1078],{"class":698},[688,2949,2950,2953,2955,2957,2960,2962],{"class":690,"line":889},[688,2951,2952],{"class":870},"  eventName",[688,2954,1068],{"class":698},[688,2956,712],{"class":698},[688,2958,2959],{"class":715},"server_request",[688,2961,873],{"class":698},[688,2963,1078],{"class":698},[688,2965,2966,2969,2971,2973,2976,2978],{"class":690,"line":1081},[688,2967,2968],{"class":870},"  distinctId",[688,2970,1068],{"class":698},[688,2972,712],{"class":698},[688,2974,2975],{"class":715},"my-backend-service",[688,2977,873],{"class":698},[688,2979,1078],{"class":698},[688,2981,2982,2984],{"class":690,"line":1096},[688,2983,892],{"class":698},[688,2985,895],{"class":702},[609,2987,2988,2989,2992,2993,2996],{},"Then pass ",[685,2990,2991],{},"drain"," to your framework the same way as the default logs drain (see ",[612,2994,25],{"href":2995},"#quick-start"," above).",[2426,2998,2999,3000,3002],{"color":2428,"icon":13},"Custom events count towards your PostHog event quota. PostHog Logs (the default ",[685,3001,1900],{},") is significantly cheaper.",[2426,3004,3007,3010,3011,3014,3015,3018],{"color":3005,"icon":3006},"warning","i-lucide-triangle-alert",[742,3008,3009],{},"Legacy:"," ",[685,3012,3013],{},"createPostHogEventsDrain()"," is deprecated and re-routes to ",[685,3016,3017],{},"createPostHogDrain({ mode: 'events' })",". It will be removed in the next major release.",[724,3020,3022],{"id":3021},"configure-which-events-go-out","Configure which events go out",[1925,3024,3025,3037],{},[1928,3026,3027],{},[1931,3028,3029,3031,3033,3035],{},[1934,3030,2133],{},[1934,3032,2136],{},[1934,3034,2139],{},[1934,3036,1939],{},[1941,3038,3039,3053,3069,3088,3106,3126,3149],{},[1931,3040,3041,3045,3049,3051],{},[1946,3042,3043],{},[685,3044,2150],{},[1946,3046,3047],{},[685,3048,2155],{},[1946,3050,2158],{},[1946,3052,2161],{},[1931,3054,3055,3059,3063,3067],{},[1946,3056,3057],{},[685,3058,2168],{},[1946,3060,3061],{},[685,3062,2155],{},[1946,3064,3065],{},[685,3066,2177],{},[1946,3068,2180],{},[1931,3070,3071,3076,3080,3085],{},[1946,3072,3073],{},[685,3074,3075],{},"eventName",[1946,3077,3078],{},[685,3079,2155],{},[1946,3081,3082],{},[685,3083,3084],{},"evlog_wide_event",[1946,3086,3087],{},"PostHog event name",[1931,3089,3090,3094,3098,3100],{},[1946,3091,3092],{},[685,3093,2187],{},[1946,3095,3096],{},[685,3097,2155],{},[1946,3099,2158],{},[1946,3101,3102,3103,3105],{},"Static ",[685,3104,2767],{}," for all events",[1931,3107,3108,3112,3116,3120],{},[1946,3109,3110],{},[685,3111,2203],{},[1946,3113,3114],{},[685,3115,2155],{},[1946,3117,3118],{},[685,3119,2212],{},[1946,3121,3122,3123,3125],{},"Event field holding the ",[685,3124,2767],{}," (dot path)",[1931,3127,3128,3132,3136,3140],{},[1946,3129,3130],{},[685,3131,2241],{},[1946,3133,3134],{},[685,3135,2246],{},[1946,3137,3138],{},[685,3139,2251],{},[1946,3141,3142,3143,3145,3146,758],{},"Event property shape: ",[685,3144,2379],{}," flattens nested fields (see ",[612,3147,2258],{"href":3148},"#event-format",[1931,3150,3151,3155,3159,3163],{},[1946,3152,3153],{},[685,3154,2265],{},[1946,3156,3157],{},[685,3158,2270],{},[1946,3160,3161],{},[685,3162,2275],{},[1946,3164,2278],{},[724,3166,3168],{"id":3167},"event-format","Event Format",[609,3170,3171],{},"evlog maps wide events to PostHog events:",[1925,3173,3174,3184],{},[1928,3175,3176],{},[1931,3177,3178,3181],{},[1934,3179,3180],{},"evlog Field",[1934,3182,3183],{},"PostHog Field",[1941,3185,3186,3204,3215,3227,3238,3250],{},[1931,3187,3188,3199],{},[1946,3189,3190,3193,3194,3193,3196],{},[685,3191,3192],{},"config.distinctId"," or ",[685,3195,2212],{},[685,3197,3198],{},"service",[1946,3200,3201,3203],{},[685,3202,2767],{}," (fallback chain)",[1931,3205,3206,3211],{},[1946,3207,3208],{},[685,3209,3210],{},"timestamp",[1946,3212,3213],{},[685,3214,3210],{},[1931,3216,3217,3222],{},[1946,3218,3219],{},[685,3220,3221],{},"level",[1946,3223,3224],{},[685,3225,3226],{},"properties.level",[1931,3228,3229,3233],{},[1946,3230,3231],{},[685,3232,3198],{},[1946,3234,3235],{},[685,3236,3237],{},"properties.service",[1931,3239,3240,3245],{},[1946,3241,3242],{},[685,3243,3244],{},"environment",[1946,3246,3247],{},[685,3248,3249],{},"properties.environment",[1931,3251,3252,3255],{},[1946,3253,3254],{},"All other fields",[1946,3256,3257],{},[685,3258,3259],{},"properties.*",[609,3261,3262,3263,3266,3267,3269,3270,2352,3273,3276,3277,3280,3281,3283,3284,3286],{},"With ",[685,3264,3265],{},"recordShape: 'compact'",", the other fields are flattened into dotted keys the same way as in logs mode: a nested ",[685,3268,2369],{}," object arrives as ",[685,3271,3272],{},"properties.ai.costUsd",[685,3274,3275],{},"properties.ai.calls"," instead of one opaque ",[685,3278,3279],{},"properties.ai"," value. PostHog can filter and break down on those individual properties; the default ",[685,3282,2365],{}," shape keeps the nested object as a single serialized property. See ",[612,3285,2359],{"href":2257}," for the trade-off and how it affects your saved views and alerts.",[724,3288,3290],{"id":3289},"how-the-distinct-id-is-resolved","How the distinct ID is resolved",[609,3292,3293,3294,3296],{},"The ",[685,3295,2767],{}," follows a fallback chain:",[633,3298,3299,3308,3319],{},[636,3300,3301,3305,3306],{},[742,3302,3303],{},[685,3304,3192],{}," - explicit override in ",[685,3307,3017],{},[636,3309,3310,3315,3316,3318],{},[742,3311,3312],{},[685,3313,3314],{},"event.userId"," - or whatever ",[685,3317,2203],{}," points at, when it holds a string or a number",[636,3320,3321,3326],{},[742,3322,3323],{},[685,3324,3325],{},"event.service"," - final fallback, sent as an anonymous event",[724,3328,3330],{"id":3329},"identified-and-anonymous-events","Identified and anonymous events",[609,3332,3333,3334,3337],{},"An event that resolves to a real person is an ",[742,3335,3336],{},"identified"," event: PostHog creates a person profile for it and attaches person properties.",[609,3339,3340,3341,1916,3344,3347],{},"When no identifier resolves, the event is sent as ",[742,3342,3343],{},"anonymous",[685,3345,3346],{},"$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,3349,3351],{"className":679,"code":3350,"filename":792,"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,3352,3353,3358,3387,3391,3396],{"__ignoreMap":683},[688,3354,3355],{"class":690,"line":691},[688,3356,3357],{"class":2026},"\u002F\u002F Identified: events carrying `userId` create and update a person profile\n",[688,3359,3360,3362,3364,3366,3368,3370,3372,3375,3377,3379,3381,3383,3385],{"class":690,"line":815},[688,3361,1724],{"class":846},[688,3363,2077],{"class":702},[688,3365,778],{"class":698},[688,3367,703],{"class":831},[688,3369,835],{"class":702},[688,3371,1175],{"class":698},[688,3373,3374],{"class":870}," mode",[688,3376,1068],{"class":698},[688,3378,712],{"class":698},[688,3380,2943],{"class":715},[688,3382,873],{"class":698},[688,3384,706],{"class":698},[688,3386,895],{"class":702},[688,3388,3389],{"class":690,"line":822},[688,3390,819],{"emptyLinePlaceholder":818},[688,3392,3393],{"class":690,"line":853},[688,3394,3395],{"class":2026},"\u002F\u002F Identified as one backend identity, whatever the request\n",[688,3397,3398,3400,3403,3405,3407,3409,3411,3413,3415,3417,3419,3421,3423,3426,3428,3430,3433,3435,3437],{"class":690,"line":889},[688,3399,1724],{"class":846},[688,3401,3402],{"class":702}," service ",[688,3404,778],{"class":698},[688,3406,703],{"class":831},[688,3408,835],{"class":702},[688,3410,1175],{"class":698},[688,3412,3374],{"class":870},[688,3414,1068],{"class":698},[688,3416,712],{"class":698},[688,3418,2943],{"class":715},[688,3420,873],{"class":698},[688,3422,881],{"class":698},[688,3424,3425],{"class":870}," distinctId",[688,3427,1068],{"class":698},[688,3429,712],{"class":698},[688,3431,3432],{"class":715},"checkout-worker",[688,3434,873],{"class":698},[688,3436,706],{"class":698},[688,3438,895],{"class":702},[2426,3440,3441],{"color":2428,"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,3443,3445],{"id":3444},"when-to-use-a-log-and-when-to-use-an-event","When to use a log and when to use an event",[1925,3447,3448,3462],{},[1928,3449,3450],{},[1931,3451,3452,3454,3458],{},[1934,3453],{},[1934,3455,3456],{},[685,3457,1900],{},[1934,3459,3460],{},[685,3461,3017],{},[1941,3463,3464,3482,3495,3507],{},[1931,3465,3466,3470,3476],{},[1946,3467,3468],{},[742,3469,2338],{},[1946,3471,3472,3473,758],{},"OTLP Logs (",[685,3474,3475],{},"\u002Fi\u002Fv1\u002Flogs",[1946,3477,3478,3479,758],{},"PostHog Events (",[685,3480,3481],{},"\u002Fbatch\u002F",[1931,3483,3484,3489,3492],{},[1946,3485,3486],{},[742,3487,3488],{},"PostHog UI",[1946,3490,3491],{},"Logs viewer",[1946,3493,3494],{},"Events explorer",[1931,3496,3497,3501,3504],{},[1946,3498,3499],{},[742,3500,573],{},[1946,3502,3503],{},"Lower (dedicated logs pipeline)",[1946,3505,3506],{},"Higher (counts as events)",[1931,3508,3509,3514,3517],{},[1946,3510,3511],{},[742,3512,3513],{},"Best for",[1946,3515,3516],{},"Debugging, log search, observability",[1946,3518,3519],{},"Product analytics, cohorts, funnels",[609,3521,3522],{},"You can use both drains simultaneously to get the best of both worlds:",[677,3524,3526],{"className":679,"code":3525,"filename":792,"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,3527,3528,3546,3550,3564,3593,3597,3619,3656],{"__ignoreMap":683},[688,3529,3530,3532,3534,3536,3538,3540,3542,3544],{"class":690,"line":691},[688,3531,695],{"class":694},[688,3533,699],{"class":698},[688,3535,703],{"class":702},[688,3537,706],{"class":698},[688,3539,709],{"class":694},[688,3541,712],{"class":698},[688,3543,716],{"class":715},[688,3545,719],{"class":698},[688,3547,3548],{"class":690,"line":815},[688,3549,819],{"emptyLinePlaceholder":818},[688,3551,3552,3554,3557,3559,3561],{"class":690,"line":822},[688,3553,1724],{"class":846},[688,3555,3556],{"class":702}," logs ",[688,3558,778],{"class":698},[688,3560,703],{"class":831},[688,3562,3563],{"class":702},"()\n",[688,3565,3566,3568,3571,3573,3575,3577,3579,3581,3583,3585,3587,3589,3591],{"class":690,"line":853},[688,3567,1724],{"class":846},[688,3569,3570],{"class":702}," events ",[688,3572,778],{"class":698},[688,3574,703],{"class":831},[688,3576,835],{"class":702},[688,3578,1175],{"class":698},[688,3580,3374],{"class":870},[688,3582,1068],{"class":698},[688,3584,712],{"class":698},[688,3586,2943],{"class":715},[688,3588,873],{"class":698},[688,3590,706],{"class":698},[688,3592,895],{"class":702},[688,3594,3595],{"class":690,"line":889},[688,3596,819],{"emptyLinePlaceholder":818},[688,3598,3599,3601,3603,3605,3608,3610,3613,3615,3617],{"class":690,"line":1081},[688,3600,1724],{"class":846},[688,3602,2077],{"class":702},[688,3604,778],{"class":698},[688,3606,3607],{"class":846}," async",[688,3609,1916],{"class":698},[688,3611,3612],{"class":840},"ctx",[688,3614,758],{"class":698},[688,3616,847],{"class":846},[688,3618,850],{"class":698},[688,3620,3621,3624,3627,3629,3632,3635,3638,3640,3642,3644,3646,3649,3651,3653],{"class":690,"line":1096},[688,3622,3623],{"class":694},"  await",[688,3625,3626],{"class":1350}," Promise",[688,3628,859],{"class":698},[688,3630,3631],{"class":831},"allSettled",[688,3633,3634],{"class":870},"([",[688,3636,3637],{"class":831},"logs",[688,3639,835],{"class":870},[688,3641,3612],{"class":702},[688,3643,758],{"class":870},[688,3645,881],{"class":698},[688,3647,3648],{"class":831}," events",[688,3650,835],{"class":870},[688,3652,3612],{"class":702},[688,3654,3655],{"class":870},")])\n",[688,3657,3658],{"class":690,"line":2054},[688,3659,3660],{"class":698},"}\n",[670,3662,3664],{"id":3663},"troubleshooting","Troubleshooting",[724,3666,3668],{"id":3667},"missing-apikey-error","Missing apiKey error",[677,3670,3676],{"className":3671,"code":3673,"filename":3674,"language":3675,"meta":683},[3672],"language-text","[evlog\u002Fposthog] Missing apiKey. Set POSTHOG_API_KEY env var or pass to createPostHogDrain()\n","Console","text",[685,3677,3673],{"__ignoreMap":683},[609,3679,3680],{},"Make sure your environment variable is set and the server was restarted after adding it.",[724,3682,3684],{"id":3683},"events-not-appearing","Events not appearing",[609,3686,3687],{},"PostHog processes events asynchronously. There may be a short delay (typically under 1 minute) before events appear in the dashboard.",[633,3689,3690,3697,3702],{},[636,3691,3692,3693,3696],{},"Check the server console for ",[685,3694,3695],{},"[evlog\u002Fposthog]"," error messages",[636,3698,3699,3700],{},"Verify your API key is correct and starts with ",[685,3701,757],{},[636,3703,3704,3705,3707],{},"Confirm your ",[685,3706,2168],{}," matches your PostHog region (US vs EU)",[724,3709,3711],{"id":3710},"wrong-region","Wrong region",[609,3713,3714,3715,3717],{},"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,3716,3695],{},") to your server console. Set the correct host:",[677,3719,3721],{"className":765,"code":3720,"filename":767,"language":768,"meta":683,"style":683},"POSTHOG_HOST=https:\u002F\u002Feu.i.posthog.com\n",[685,3722,3723],{"__ignoreMap":683},[688,3724,3725,3727,3729],{"class":690,"line":691},[688,3726,1961],{"class":702},[688,3728,778],{"class":698},[688,3730,2854],{"class":715},[670,3732,3734],{"id":3733},"call-the-drain-without-a-framework","Call the drain without a framework",[609,3736,3737],{},"For advanced use cases, you can use the lower-level functions:",[677,3739,3742],{"className":679,"code":3740,"filename":3741,"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,3743,3744,3768,3772,3777,3790,3806,3812,3816,3821,3835,3850],{"__ignoreMap":683},[688,3745,3746,3748,3750,3753,3755,3758,3760,3762,3764,3766],{"class":690,"line":691},[688,3747,695],{"class":694},[688,3749,699],{"class":698},[688,3751,3752],{"class":702}," sendToPostHog",[688,3754,881],{"class":698},[688,3756,3757],{"class":702}," sendBatchToPostHog",[688,3759,706],{"class":698},[688,3761,709],{"class":694},[688,3763,712],{"class":698},[688,3765,716],{"class":715},[688,3767,719],{"class":698},[688,3769,3770],{"class":690,"line":815},[688,3771,819],{"emptyLinePlaceholder":818},[688,3773,3774],{"class":690,"line":822},[688,3775,3776],{"class":2026},"\u002F\u002F Send a single event to PostHog Logs (OTLP)\n",[688,3778,3779,3781,3783,3786,3788],{"class":690,"line":853},[688,3780,1537],{"class":694},[688,3782,3752],{"class":831},[688,3784,3785],{"class":702},"(event",[688,3787,881],{"class":698},[688,3789,850],{"class":698},[688,3791,3792,3795,3797,3799,3802,3804],{"class":690,"line":889},[688,3793,3794],{"class":870},"  apiKey",[688,3796,1068],{"class":698},[688,3798,712],{"class":698},[688,3800,3801],{"class":715},"phc_xxx",[688,3803,873],{"class":698},[688,3805,1078],{"class":698},[688,3807,3808,3810],{"class":690,"line":1081},[688,3809,892],{"class":698},[688,3811,895],{"class":702},[688,3813,3814],{"class":690,"line":1096},[688,3815,819],{"emptyLinePlaceholder":818},[688,3817,3818],{"class":690,"line":2054},[688,3819,3820],{"class":2026},"\u002F\u002F Send multiple events in one request\n",[688,3822,3824,3826,3828,3831,3833],{"class":690,"line":3823},9,[688,3825,1537],{"class":694},[688,3827,3757],{"class":831},[688,3829,3830],{"class":702},"(events",[688,3832,881],{"class":698},[688,3834,850],{"class":698},[688,3836,3838,3840,3842,3844,3846,3848],{"class":690,"line":3837},10,[688,3839,3794],{"class":870},[688,3841,1068],{"class":698},[688,3843,712],{"class":698},[688,3845,3801],{"class":715},[688,3847,873],{"class":698},[688,3849,1078],{"class":698},[688,3851,3853,3855],{"class":690,"line":3852},11,[688,3854,892],{"class":698},[688,3856,895],{"class":702},[609,3858,3859],{},"For custom events, use the events-specific functions:",[677,3861,3863],{"className":679,"code":3862,"filename":3741,"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,3864,3865,3894,3898,3903,3915,3929,3935,3939,3944,3956,3970,3976,3981,3987],{"__ignoreMap":683},[688,3866,3867,3869,3871,3874,3876,3879,3881,3884,3886,3888,3890,3892],{"class":690,"line":691},[688,3868,695],{"class":694},[688,3870,699],{"class":698},[688,3872,3873],{"class":702}," sendToPostHogEvents",[688,3875,881],{"class":698},[688,3877,3878],{"class":702}," sendBatchToPostHogEvents",[688,3880,881],{"class":698},[688,3882,3883],{"class":702}," toPostHogEvent",[688,3885,706],{"class":698},[688,3887,709],{"class":694},[688,3889,712],{"class":698},[688,3891,716],{"class":715},[688,3893,719],{"class":698},[688,3895,3896],{"class":690,"line":815},[688,3897,819],{"emptyLinePlaceholder":818},[688,3899,3900],{"class":690,"line":822},[688,3901,3902],{"class":2026},"\u002F\u002F Send a single custom event\n",[688,3904,3905,3907,3909,3911,3913],{"class":690,"line":853},[688,3906,1537],{"class":694},[688,3908,3873],{"class":831},[688,3910,3785],{"class":702},[688,3912,881],{"class":698},[688,3914,850],{"class":698},[688,3916,3917,3919,3921,3923,3925,3927],{"class":690,"line":889},[688,3918,3794],{"class":870},[688,3920,1068],{"class":698},[688,3922,712],{"class":698},[688,3924,3801],{"class":715},[688,3926,873],{"class":698},[688,3928,1078],{"class":698},[688,3930,3931,3933],{"class":690,"line":1081},[688,3932,892],{"class":698},[688,3934,895],{"class":702},[688,3936,3937],{"class":690,"line":1096},[688,3938,819],{"emptyLinePlaceholder":818},[688,3940,3941],{"class":690,"line":2054},[688,3942,3943],{"class":2026},"\u002F\u002F Send multiple custom events in one request\n",[688,3945,3946,3948,3950,3952,3954],{"class":690,"line":3823},[688,3947,1537],{"class":694},[688,3949,3878],{"class":831},[688,3951,3830],{"class":702},[688,3953,881],{"class":698},[688,3955,850],{"class":698},[688,3957,3958,3960,3962,3964,3966,3968],{"class":690,"line":3837},[688,3959,3794],{"class":870},[688,3961,1068],{"class":698},[688,3963,712],{"class":698},[688,3965,3801],{"class":715},[688,3967,873],{"class":698},[688,3969,1078],{"class":698},[688,3971,3972,3974],{"class":690,"line":3852},[688,3973,892],{"class":698},[688,3975,895],{"class":702},[688,3977,3979],{"class":690,"line":3978},12,[688,3980,819],{"emptyLinePlaceholder":818},[688,3982,3984],{"class":690,"line":3983},13,[688,3985,3986],{"class":2026},"\u002F\u002F Convert event to PostHog format (for inspection)\n",[688,3988,3990,3992,3995,3997,3999,4001,4003,4005,4008,4010,4012,4014,4016,4018],{"class":690,"line":3989},14,[688,3991,1724],{"class":846},[688,3993,3994],{"class":702}," posthogEvent ",[688,3996,778],{"class":698},[688,3998,3883],{"class":831},[688,4000,3785],{"class":702},[688,4002,881],{"class":698},[688,4004,699],{"class":698},[688,4006,4007],{"class":870}," apiKey",[688,4009,1068],{"class":698},[688,4011,712],{"class":698},[688,4013,3801],{"class":715},[688,4015,873],{"class":698},[688,4017,706],{"class":698},[688,4019,895],{"class":702},[670,4021,4023],{"id":4022},"next-steps","Next Steps",[2313,4025,4026,4032,4038,4044],{},[636,4027,4028,4031],{},[612,4029,4030],{"href":162},"Axiom Adapter"," - Send logs to Axiom",[636,4033,4034,4037],{},[612,4035,4036],{"href":202},"OTLP Adapter"," - Send logs via OpenTelemetry Protocol",[636,4039,4040,4043],{},[612,4041,4042],{"href":530},"Custom Adapters"," - Build your own adapter",[636,4045,4046,4048],{},[612,4047,560],{"href":561}," - Security and production tips",[4050,4051,4052],"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 .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 .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}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 .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":683,"searchDepth":815,"depth":815,"links":4054},[4055,4056,4061,4067,4068,4069,4072,4073,4074,4081,4086,4087],{"id":672,"depth":815,"text":20},{"id":722,"depth":815,"text":25,"children":4057},[4058,4059,4060],{"id":726,"depth":822,"text":727},{"id":761,"depth":822,"text":762},{"id":784,"depth":822,"text":785},{"id":1886,"depth":815,"text":547,"children":4062},[4063,4064,4065,4066],{"id":1922,"depth":822,"text":1923},{"id":1967,"depth":822,"text":1968},{"id":2061,"depth":822,"text":2062},{"id":2123,"depth":822,"text":2124},{"id":2300,"depth":815,"text":2301},{"id":2358,"depth":815,"text":2359},{"id":2437,"depth":815,"text":2438,"children":4070},[4071],{"id":2651,"depth":822,"text":2652},{"id":2779,"depth":815,"text":2780},{"id":2857,"depth":815,"text":2858},{"id":2880,"depth":815,"text":2881,"children":4075},[4076,4077,4078,4079,4080],{"id":3021,"depth":822,"text":3022},{"id":3167,"depth":822,"text":3168},{"id":3289,"depth":822,"text":3290},{"id":3329,"depth":822,"text":3330},{"id":3444,"depth":822,"text":3445},{"id":3663,"depth":815,"text":3664,"children":4082},[4083,4084,4085],{"id":3667,"depth":822,"text":3668},{"id":3683,"depth":822,"text":3684},{"id":3710,"depth":822,"text":3711},{"id":3733,"depth":815,"text":3734},{"id":4022,"depth":815,"text":4023},"Send wide events to PostHog Logs via OTLP for structured log querying, debugging, and observability in your PostHog dashboard.","md",[4091,4097],{"label":4092,"icon":4093,"to":735,"target":4094,"color":4095,"variant":4096},"PostHog Dashboard","i-lucide-external-link","_blank","neutral","subtle",{"label":4030,"icon":164,"to":162,"color":4095,"variant":4096},{},{"title":166,"icon":169},{"title":604,"description":4088},"nH8Y3oytL1BCmQoMlOb1PY3CKS5_mkuhG1D-BprkNjM",[4103,4105],{"title":161,"path":162,"stem":163,"description":4104,"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":4106,"icon":174,"children":-1},"Send structured logs to Sentry Logs for high-cardinality querying and debugging. Zero-config setup with environment variables.",1791054014887]