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