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