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