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