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