[{"data":1,"prerenderedAt":1296},["ShallowReactive",2],{"navigation_docs":3,"-libraries-emitting":598,"-libraries-emitting-surround":1291},[4,35,85,138,318,453,475,534,573],{"title":5,"path":6,"stem":7,"children":8,"page":34},"Start","\u002Fstart","1.start",[9,14,19,24,29],{"title":10,"path":11,"stem":12,"icon":13},"Introduction","\u002Fstart\u002Fintroduction","1.start\u002F1.introduction","i-lucide-info",{"title":15,"path":16,"stem":17,"icon":18},"Why start with evlog","\u002Fstart\u002Fwhy-evlog","1.start\u002F2.why-evlog","i-lucide-rocket",{"title":20,"path":21,"stem":22,"icon":23},"Installation","\u002Fstart\u002Finstallation","1.start\u002F3.installation","i-lucide-download",{"title":25,"path":26,"stem":27,"icon":28},"Quick Start","\u002Fstart\u002Fquick-start","1.start\u002F4.quick-start","i-lucide-zap",{"title":30,"path":31,"stem":32,"icon":33},"Choose your logger","\u002Fstart\u002Ftypescript-logging-library","1.start\u002F5.typescript-logging-library","i-lucide-file-code",false,{"title":36,"path":37,"stem":38,"children":39,"page":34},"Learn","\u002Flearn","2.learn",[40,45,50,55,60,65,70,75,80],{"title":41,"path":42,"stem":43,"icon":44},"Overview","\u002Flearn\u002Foverview","2.learn\u002F0.overview","i-lucide-list",{"title":46,"path":47,"stem":48,"icon":49},"Simple Logging","\u002Flearn\u002Fsimple-logging","2.learn\u002F1.simple-logging","i-lucide-terminal",{"title":51,"path":52,"stem":53,"icon":54},"Wide Events","\u002Flearn\u002Fwide-events","2.learn\u002F2.wide-events","i-lucide-layers",{"title":56,"path":57,"stem":58,"icon":59},"Structured Errors","\u002Flearn\u002Fstructured-errors","2.learn\u002F3.structured-errors","i-lucide-shield-alert",{"title":61,"path":62,"stem":63,"icon":64},"Lifecycle","\u002Flearn\u002Flifecycle","2.learn\u002F4.lifecycle","i-lucide-arrow-right-left",{"title":66,"path":67,"stem":68,"icon":69},"Sampling","\u002Flearn\u002Fsampling","2.learn\u002F5.sampling","i-lucide-filter",{"title":71,"path":72,"stem":73,"icon":74},"Auto-Redaction","\u002Flearn\u002Fredaction","2.learn\u002F6.redaction","i-lucide-eye-off",{"title":76,"path":77,"stem":78,"icon":79},"Typed Fields","\u002Flearn\u002Ftyped-fields","2.learn\u002F7.typed-fields","i-simple-icons-typescript",{"title":81,"path":82,"stem":83,"icon":84},"Catalogs","\u002Flearn\u002Fcatalogs","2.learn\u002F8.catalogs","i-lucide-book-open",{"title":86,"path":87,"stem":88,"children":89,"page":34},"CLI","\u002Fcli","3.cli",[90,93,98,103,108,113,118,123,128,133],{"title":41,"path":91,"stem":92,"icon":49},"\u002Fcli\u002Foverview","3.cli\u002F0.overview",{"title":94,"path":95,"stem":96,"icon":97},"init","\u002Fcli\u002Finit","3.cli\u002F1.init","i-lucide-wand-sparkles",{"title":99,"path":100,"stem":101,"icon":102},"map","\u002Fcli\u002Fmap","3.cli\u002F2.map","i-lucide-radar",{"title":104,"path":105,"stem":106,"icon":107},"Rules","\u002Fcli\u002Frules","3.cli\u002F3.rules","i-lucide-list-checks",{"title":109,"path":110,"stem":111,"icon":112},"Scoring","\u002Fcli\u002Fscoring","3.cli\u002F4.scoring","i-lucide-gauge",{"title":114,"path":115,"stem":116,"icon":117},"CI","\u002Fcli\u002Fci","3.cli\u002F5.ci","i-lucide-git-pull-request",{"title":119,"path":120,"stem":121,"icon":122},"doctor","\u002Fcli\u002Fdoctor","3.cli\u002F6.doctor","i-lucide-stethoscope",{"title":124,"path":125,"stem":126,"icon":127},"telemetry","\u002Fcli\u002Ftelemetry","3.cli\u002F7.telemetry","i-lucide-bar-chart-3",{"title":129,"path":130,"stem":131,"icon":132},"agents","\u002Fcli\u002Fagents","3.cli\u002F8.agents","i-lucide-bot",{"title":134,"path":135,"stem":136,"icon":137},"Observability Score","\u002Fcli\u002Fobservability-score","3.cli\u002F9.observability-score","i-lucide-activity",{"title":139,"path":140,"stem":141,"children":142,"page":34},"Integrate","\u002Fintegrate","4.integrate",[143,147,230],{"title":41,"path":144,"stem":145,"icon":146},"\u002Fintegrate\u002Foverview","4.integrate\u002F0.overview","i-lucide-plug",{"title":148,"path":149,"stem":150,"children":151,"page":34},"Adapters","\u002Fintegrate\u002Fadapters","4.integrate\u002Fadapters",[152,155,185,210],{"title":41,"path":153,"stem":154,"icon":44},"\u002Fintegrate\u002Fadapters\u002Foverview","4.integrate\u002Fadapters\u002F01.overview",{"title":156,"path":157,"stem":158,"children":159,"page":34},"Cloud","\u002Fintegrate\u002Fadapters\u002Fcloud","4.integrate\u002Fadapters\u002Fcloud",[160,165,170,175,180],{"title":161,"path":162,"stem":163,"icon":164},"Axiom","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Faxiom","4.integrate\u002Fadapters\u002Fcloud\u002F01.axiom","i-custom-axiom",{"title":166,"path":167,"stem":168,"icon":169},"PostHog","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fposthog","4.integrate\u002Fadapters\u002Fcloud\u002F02.posthog","i-simple-icons-posthog",{"title":171,"path":172,"stem":173,"icon":174},"Sentry","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fsentry","4.integrate\u002Fadapters\u002Fcloud\u002F03.sentry","i-simple-icons-sentry",{"title":176,"path":177,"stem":178,"icon":179},"Better Stack","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fbetter-stack","4.integrate\u002Fadapters\u002Fcloud\u002F04.better-stack","i-simple-icons-betterstack",{"title":181,"path":182,"stem":183,"icon":184},"Datadog","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fdatadog","4.integrate\u002Fadapters\u002Fcloud\u002F05.datadog","i-simple-icons-datadog",{"title":186,"path":187,"stem":188,"children":189,"page":34},"Cloud or Self-Hosted","\u002Fintegrate\u002Fadapters\u002Fhybrid","4.integrate\u002Fadapters\u002Fhybrid",[190,195,200,205],{"title":191,"path":192,"stem":193,"icon":194},"Grafana Loki","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Floki","4.integrate\u002Fadapters\u002Fhybrid\u002F01.loki","i-simple-icons-grafana",{"title":196,"path":197,"stem":198,"icon":199},"ClickHouse","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Fclickhouse","4.integrate\u002Fadapters\u002Fhybrid\u002F02.clickhouse","i-simple-icons-clickhouse",{"title":201,"path":202,"stem":203,"icon":204},"OTLP","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Fotlp","4.integrate\u002Fadapters\u002Fhybrid\u002F03.otlp","i-simple-icons-opentelemetry",{"title":206,"path":207,"stem":208,"icon":209},"HyperDX","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Fhyperdx","4.integrate\u002Fadapters\u002Fhybrid\u002F04.hyperdx","i-custom-hyperdx",{"title":211,"path":212,"stem":213,"children":214,"page":34},"Self-Hosted","\u002Fintegrate\u002Fadapters\u002Fself-hosted","4.integrate\u002Fadapters\u002Fself-hosted",[215,220,225],{"title":216,"path":217,"stem":218,"icon":219},"File System","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Ffs","4.integrate\u002Fadapters\u002Fself-hosted\u002F01.fs","i-lucide-hard-drive",{"title":221,"path":222,"stem":223,"icon":224},"NuxtHub","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Fnuxthub","4.integrate\u002Fadapters\u002Fself-hosted\u002F02.nuxthub","i-simple-icons-nuxt",{"title":226,"path":227,"stem":228,"icon":229},"Memory","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Fmemory","4.integrate\u002Fadapters\u002Fself-hosted\u002F03.memory","i-lucide-cpu",{"title":231,"path":232,"stem":233,"children":234,"page":34},"Frameworks","\u002Fintegrate\u002Fframeworks","4.integrate\u002Fframeworks",[235,239,244,249,254,259,264,269,274,279,284,289,294,299,303,308,313],{"title":41,"path":236,"stem":237,"icon":238},"\u002Fintegrate\u002Fframeworks\u002Foverview","4.integrate\u002Fframeworks\u002F00.overview","i-lucide-layout-grid",{"title":240,"path":241,"stem":242,"icon":243},"Nuxt","\u002Fintegrate\u002Fframeworks\u002Fnuxt","4.integrate\u002Fframeworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":245,"path":246,"stem":247,"icon":248},"Next.js","\u002Fintegrate\u002Fframeworks\u002Fnextjs","4.integrate\u002Fframeworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":250,"path":251,"stem":252,"icon":253},"SvelteKit","\u002Fintegrate\u002Fframeworks\u002Fsveltekit","4.integrate\u002Fframeworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":255,"path":256,"stem":257,"icon":258},"Nitro","\u002Fintegrate\u002Fframeworks\u002Fnitro","4.integrate\u002Fframeworks\u002F04.nitro","i-custom-nitro",{"title":260,"path":261,"stem":262,"icon":263},"TanStack Start","\u002Fintegrate\u002Fframeworks\u002Ftanstack-start","4.integrate\u002Fframeworks\u002F05.tanstack-start","i-custom-tanstack",{"title":265,"path":266,"stem":267,"icon":268},"NestJS","\u002Fintegrate\u002Fframeworks\u002Fnestjs","4.integrate\u002Fframeworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":270,"path":271,"stem":272,"icon":273},"Express","\u002Fintegrate\u002Fframeworks\u002Fexpress","4.integrate\u002Fframeworks\u002F07.express","i-simple-icons-express",{"title":275,"path":276,"stem":277,"icon":278},"Hono","\u002Fintegrate\u002Fframeworks\u002Fhono","4.integrate\u002Fframeworks\u002F08.hono","i-simple-icons-hono",{"title":280,"path":281,"stem":282,"icon":283},"Fastify","\u002Fintegrate\u002Fframeworks\u002Ffastify","4.integrate\u002Fframeworks\u002F09.fastify","i-simple-icons-fastify",{"title":285,"path":286,"stem":287,"icon":288},"Elysia","\u002Fintegrate\u002Fframeworks\u002Felysia","4.integrate\u002Fframeworks\u002F10.elysia","i-custom-elysia",{"title":290,"path":291,"stem":292,"icon":293},"React Router","\u002Fintegrate\u002Fframeworks\u002Freact-router","4.integrate\u002Fframeworks\u002F11.react-router","i-custom-reactrouter",{"title":295,"path":296,"stem":297,"icon":298},"Cloudflare Workers","\u002Fintegrate\u002Fframeworks\u002Fcloudflare-workers","4.integrate\u002Fframeworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":300,"path":301,"stem":302,"icon":79},"Standalone","\u002Fintegrate\u002Fframeworks\u002Fstandalone","4.integrate\u002Fframeworks\u002F13.standalone",{"title":304,"path":305,"stem":306,"icon":307},"Astro","\u002Fintegrate\u002Fframeworks\u002Fastro","4.integrate\u002Fframeworks\u002F14.astro","i-simple-icons-astro",{"title":309,"path":310,"stem":311,"icon":312},"oRPC","\u002Fintegrate\u002Fframeworks\u002Forpc","4.integrate\u002Fframeworks\u002F15.orpc","i-lucide-network",{"title":314,"path":315,"stem":316,"icon":317},"AWS Lambda","\u002Fintegrate\u002Fframeworks\u002Faws-lambda","4.integrate\u002Fframeworks\u002F16.aws-lambda","i-custom-lambda",{"title":319,"path":320,"stem":321,"children":322,"page":34},"Use Cases","\u002Fuse-cases","5.use-cases",[323,326,331,359,386,418,439,444,449],{"title":41,"path":324,"stem":325,"icon":107},"\u002Fuse-cases\u002Foverview","5.use-cases\u002F0.overview",{"title":327,"path":328,"stem":329,"icon":330},"Client Logging","\u002Fuse-cases\u002Fclient-logging","5.use-cases\u002F1.client-logging","i-lucide-monitor",{"title":332,"icon":333,"path":334,"stem":335,"children":336,"page":34},"AI SDK","i-simple-icons-vercel","\u002Fuse-cases\u002Fai-sdk","5.use-cases\u002F2.ai-sdk",[337,340,345,350,355],{"title":41,"path":338,"stem":339,"icon":44},"\u002Fuse-cases\u002Fai-sdk\u002Foverview","5.use-cases\u002F2.ai-sdk\u002F01.overview",{"title":341,"path":342,"stem":343,"icon":344},"Usage","\u002Fuse-cases\u002Fai-sdk\u002Fusage","5.use-cases\u002F2.ai-sdk\u002F02.usage","i-lucide-code",{"title":346,"path":347,"stem":348,"icon":349},"Options","\u002Fuse-cases\u002Fai-sdk\u002Foptions","5.use-cases\u002F2.ai-sdk\u002F03.options","i-lucide-sliders",{"title":351,"path":352,"stem":353,"icon":354},"Metadata","\u002Fuse-cases\u002Fai-sdk\u002Fmetadata","5.use-cases\u002F2.ai-sdk\u002F04.metadata","i-lucide-database",{"title":356,"path":357,"stem":358,"icon":137},"Telemetry","\u002Fuse-cases\u002Fai-sdk\u002Ftelemetry","5.use-cases\u002F2.ai-sdk\u002F05.telemetry",{"title":360,"icon":361,"path":362,"stem":363,"children":364,"page":34},"Better Auth","i-simple-icons-betterauth","\u002Fuse-cases\u002Fbetter-auth","5.use-cases\u002F3.better-auth",[365,368,373,378,382],{"title":41,"path":366,"stem":367,"icon":44},"\u002Fuse-cases\u002Fbetter-auth\u002Foverview","5.use-cases\u002F3.better-auth\u002F01.overview",{"title":369,"path":370,"stem":371,"icon":372},"Identify User","\u002Fuse-cases\u002Fbetter-auth\u002Fidentify-user","5.use-cases\u002F3.better-auth\u002F02.identify-user","i-lucide-user-check",{"title":374,"path":375,"stem":376,"icon":377},"Middleware","\u002Fuse-cases\u002Fbetter-auth\u002Fmiddleware","5.use-cases\u002F3.better-auth\u002F03.middleware","i-lucide-shield",{"title":379,"path":380,"stem":381,"icon":330},"Client Sync","\u002Fuse-cases\u002Fbetter-auth\u002Fclient-sync","5.use-cases\u002F3.better-auth\u002F04.client-sync",{"title":383,"path":384,"stem":385,"icon":112},"Performance","\u002Fuse-cases\u002Fbetter-auth\u002Fperformance","5.use-cases\u002F3.better-auth\u002F05.performance",{"title":387,"icon":388,"path":389,"stem":390,"children":391,"page":34},"Audit Logs","i-lucide-shield-check","\u002Fuse-cases\u002Faudit","5.use-cases\u002F4.audit",[392,395,400,405,410,414],{"title":41,"path":393,"stem":394,"icon":44},"\u002Fuse-cases\u002Faudit\u002Foverview","5.use-cases\u002F4.audit\u002F01.overview",{"title":396,"path":397,"stem":398,"icon":399},"Schema","\u002Fuse-cases\u002Faudit\u002Fschema","5.use-cases\u002F4.audit\u002F02.schema","i-lucide-file-text",{"title":401,"path":402,"stem":403,"icon":404},"Recording","\u002Fuse-cases\u002Faudit\u002Frecording","5.use-cases\u002F4.audit\u002F03.recording","i-lucide-pen-line",{"title":406,"path":407,"stem":408,"icon":409},"Drains","\u002Fuse-cases\u002Faudit\u002Fpipeline","5.use-cases\u002F4.audit\u002F04.pipeline","i-lucide-link",{"title":411,"path":412,"stem":413,"icon":388},"Compliance","\u002Fuse-cases\u002Faudit\u002Fcompliance","5.use-cases\u002F4.audit\u002F05.compliance",{"title":415,"path":416,"stem":417,"icon":84},"Recipes","\u002Fuse-cases\u002Faudit\u002Frecipes","5.use-cases\u002F4.audit\u002F06.recipes",{"title":356,"icon":112,"path":419,"stem":420,"children":421,"page":34},"\u002Fuse-cases\u002Ftelemetry","5.use-cases\u002F4.telemetry",[422,425,430,435],{"title":41,"path":423,"stem":424,"icon":44},"\u002Fuse-cases\u002Ftelemetry\u002Foverview","5.use-cases\u002F4.telemetry\u002F01.overview",{"title":426,"path":427,"stem":428,"icon":429},"Setup","\u002Fuse-cases\u002Ftelemetry\u002Fsetup","5.use-cases\u002F4.telemetry\u002F02.setup","i-lucide-wrench",{"title":431,"path":432,"stem":433,"icon":434},"Ingest","\u002Fuse-cases\u002Ftelemetry\u002Fingest","5.use-cases\u002F4.telemetry\u002F03.ingest","i-lucide-server",{"title":436,"path":437,"stem":438,"icon":84},"Reference","\u002Fuse-cases\u002Ftelemetry\u002Freference","5.use-cases\u002F4.telemetry\u002F04.reference",{"title":440,"path":441,"stem":442,"icon":443},"Enrichers","\u002Fuse-cases\u002Fenrichers","5.use-cases\u002F5.enrichers","i-lucide-sparkles",{"title":445,"path":446,"stem":447,"icon":448},"eve","\u002Fuse-cases\u002Feve","5.use-cases\u002F5.eve","i-custom-eve",{"title":450,"path":451,"stem":452,"icon":434},"Node.js request logging","\u002Fuse-cases\u002Fstructured-logging-nodejs","5.use-cases\u002F6.structured-logging-nodejs",{"title":454,"path":455,"stem":456,"children":457,"page":34},"Libraries","\u002Flibraries","6.libraries",[458,462,467,470],{"title":41,"path":459,"stem":460,"icon":461},"\u002Flibraries\u002Foverview","6.libraries\u002F0.overview","i-lucide-package",{"title":463,"path":464,"stem":465,"icon":466},"Emitting Events","\u002Flibraries\u002Femitting","6.libraries\u002F1.emitting","i-lucide-radio",{"title":56,"path":468,"stem":469,"icon":59},"\u002Flibraries\u002Ferrors","6.libraries\u002F2.errors",{"title":471,"path":472,"stem":473,"icon":474},"Testing","\u002Flibraries\u002Ftesting","6.libraries\u002F3.testing","i-lucide-flask-conical",{"title":476,"path":477,"stem":478,"children":479,"page":34},"Extend","\u002Fextend","7.extend",[480,484,489,494,498,503,507,511,515,519,524,529],{"title":41,"path":481,"stem":482,"icon":483},"\u002Fextend\u002Foverview","7.extend\u002F0.overview","i-lucide-blocks",{"title":485,"path":486,"stem":487,"icon":488},"Stream","\u002Fextend\u002Fstream","7.extend\u002F1.stream","i-lucide-radio-tower",{"title":490,"path":491,"stem":492,"icon":493},"Custom framework","\u002Fextend\u002Fcustom-framework","7.extend\u002F10.custom-framework","i-lucide-puzzle",{"title":495,"path":496,"stem":497,"icon":488},"Diagnostics channel","\u002Fextend\u002Fdiagnostics-channel","7.extend\u002F11.diagnostics-channel",{"title":499,"path":500,"stem":501,"icon":502},"FS reader","\u002Fextend\u002Ffs-reader","7.extend\u002F2.fs-reader","i-lucide-folder-search",{"title":415,"path":504,"stem":505,"icon":506},"\u002Fextend\u002Fconsumer-recipes","7.extend\u002F3.consumer-recipes","i-lucide-chef-hat",{"title":508,"path":509,"stem":510,"icon":483},"Plugins","\u002Fextend\u002Fplugins","7.extend\u002F4.plugins",{"title":512,"path":513,"stem":514,"icon":443},"Custom enrichers","\u002Fextend\u002Fcustom-enrichers","7.extend\u002F5.custom-enrichers",{"title":516,"path":517,"stem":518,"icon":69},"Tail sampling","\u002Fextend\u002Ftail-sampling","7.extend\u002F6.tail-sampling",{"title":520,"path":521,"stem":522,"icon":523},"Identity headers","\u002Fextend\u002Fidentity-headers","7.extend\u002F7.identity-headers","i-lucide-fingerprint",{"title":525,"path":526,"stem":527,"icon":528},"Custom drains","\u002Fextend\u002Fcustom-drains","7.extend\u002F8.custom-drains","i-lucide-share-2",{"title":530,"path":531,"stem":532,"icon":533},"Drain pipeline","\u002Fextend\u002Fdrain-pipeline","7.extend\u002F9.drain-pipeline","i-lucide-workflow",{"title":436,"path":535,"stem":536,"children":537,"page":34},"\u002Freference","8.reference",[538,542,547,550,555,559,564,568],{"title":41,"path":539,"stem":540,"icon":541},"\u002Freference\u002Foverview","8.reference\u002F0.overview","i-lucide-book-marked",{"title":543,"path":544,"stem":545,"icon":546},"Configuration","\u002Freference\u002Fconfiguration","8.reference\u002F1.configuration","i-lucide-settings",{"title":383,"path":548,"stem":549,"icon":112},"\u002Freference\u002Fperformance","8.reference\u002F2.performance",{"title":551,"path":552,"stem":553,"icon":554},"Vite Plugin","\u002Freference\u002Fvite-plugin","8.reference\u002F3.vite-plugin","i-custom-vite",{"title":556,"path":557,"stem":558,"icon":388},"Best Practices","\u002Freference\u002Fbest-practices","8.reference\u002F4.best-practices",{"title":560,"path":561,"stem":562,"icon":563},"vs Other Loggers","\u002Freference\u002Fvs-other-loggers","8.reference\u002F5.vs-other-loggers","i-lucide-scale",{"title":565,"path":566,"stem":567,"icon":443},"Agent Skills","\u002Freference\u002Fagent-skills","8.reference\u002F6.agent-skills",{"title":569,"path":570,"stem":571,"icon":572},"Cost","\u002Freference\u002Fcost","8.reference\u002F7.cost","i-lucide-receipt",{"title":574,"path":575,"stem":576,"children":577,"page":34},"Compare","\u002Fcompare","9.compare",[578,582,586,590,594],{"title":579,"path":580,"stem":581,"icon":563},"evlog vs Pino","\u002Fcompare\u002Fpino","9.compare\u002F1.pino",{"title":583,"path":584,"stem":585,"icon":204},"evlog vs OpenTelemetry","\u002Fcompare\u002Fopentelemetry","9.compare\u002F2.opentelemetry",{"title":587,"path":588,"stem":589,"icon":563},"evlog vs LogTape","\u002Fcompare\u002Flogtape","9.compare\u002F3.logtape",{"title":591,"path":592,"stem":593,"icon":563},"evlog vs Winston: formats and request events","\u002Fcompare\u002Fwinston","9.compare\u002F4.winston",{"title":595,"path":596,"stem":597,"icon":563},"evlog vs Consola: reporters and request context","\u002Fcompare\u002Fconsola","9.compare\u002F5.consola",{"id":599,"title":463,"body":600,"description":1284,"extension":1285,"links":1286,"meta":1287,"navigation":1288,"path":464,"seo":1289,"stem":465,"__hash__":1290},"docs\u002F6.libraries\u002F1.emitting.md",{"type":601,"value":602,"toc":1278},"minimark",[603,607,621,626,637,663,666,849,852,856,867,1023,1037,1041,1044,1157,1176,1187,1194,1198,1204,1210,1266,1269,1274],[604,605,606],"p",{},"Your package runs inside someone else's process. When it logs, the events land in the host's stream, pass through the host's redaction, and reach whatever drains the host configured. This page covers emitting so the host can tell your events from its own, in four situations: plain progress, wide events, running inside a request, and a dependency graph that contains more than one copy of evlog.",[608,609,612,613,617,618,620],"callout",{"color":610,"icon":611},"warning","i-lucide-alert-triangle","Never call ",[614,615,616],"code",{},"initLogger()"," from library code, and configure nothing at import time. ",[614,619,616],{}," writes process-wide state shared by every evlog copy of the same major version, and the last call wins. A library that calls it replaces the host's drain, sampling, and redaction for the whole process, on a path the host's own code never executed.",[622,623,625],"h2",{"id":624},"emit-progress-with-the-global-log-api","Emit progress with the global log API",[604,627,628,629,632,633,636],{},"Use the global ",[614,630,631],{},"log"," API the way you would use ",[614,634,635],{},"console.log",". It works whether or not the host configured evlog: without configuration it prints (pretty in development, JSON otherwise). The form you call decides how the event travels:",[638,639,640,648],"ul",{},[641,642,643,644,647],"li",{},"The object form, ",[614,645,646],{},"log.info({ source: 'mylib.client', message: 'GET \u002Fusers' })",", always becomes a wide event through the host's pipeline: sampled, redacted, and delivered to the drain the host configured.",[641,649,650,651,654,655,658,659,662],{},"The tagged form, ",[614,652,653],{},"log.info('mylib.client', 'GET \u002Fusers')",", prints through the host's pretty printer when pretty is on (the development default) and reaches neither a drain nor redaction there. In JSON mode it becomes a small wide event carrying ",[614,656,657],{},"tag"," and ",[614,660,661],{},"message",".",[604,664,665],{},"If the host may be draining, prefer the object form and keep your package name in a field so the event stays filterable:",[667,668,674],"pre",{"className":669,"code":670,"filename":671,"language":672,"meta":673,"style":673},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { log } from 'evlog'\n\nexport class ApiClient {\n  async request(path: string): Promise\u003CResponse> {\n    log.info({ source: 'mylib.client', message: `GET ${path}` })\n    \u002F\u002F ...\n  }\n}\n","src\u002Fclient.ts","typescript","",[614,675,676,709,716,733,773,830,837,843],{"__ignoreMap":673},[677,678,681,685,689,693,696,699,702,706],"span",{"class":679,"line":680},"line",1,[677,682,684],{"class":683},"s7zQu","import",[677,686,688],{"class":687},"sMK4o"," {",[677,690,692],{"class":691},"sTEyZ"," log",[677,694,695],{"class":687}," }",[677,697,698],{"class":683}," from",[677,700,701],{"class":687}," '",[677,703,705],{"class":704},"sfazB","evlog",[677,707,708],{"class":687},"'\n",[677,710,712],{"class":679,"line":711},2,[677,713,715],{"emptyLinePlaceholder":714},true,"\n",[677,717,719,722,726,730],{"class":679,"line":718},3,[677,720,721],{"class":683},"export",[677,723,725],{"class":724},"spNyl"," class",[677,727,729],{"class":728},"sBMFI"," ApiClient",[677,731,732],{"class":687}," {\n",[677,734,736,739,743,746,750,753,756,759,762,765,768,771],{"class":679,"line":735},4,[677,737,738],{"class":724},"  async",[677,740,742],{"class":741},"swJcz"," request",[677,744,745],{"class":687},"(",[677,747,749],{"class":748},"sHdIc","path",[677,751,752],{"class":687},":",[677,754,755],{"class":728}," string",[677,757,758],{"class":687},"):",[677,760,761],{"class":728}," Promise",[677,763,764],{"class":687},"\u003C",[677,766,767],{"class":728},"Response",[677,769,770],{"class":687},">",[677,772,732],{"class":687},[677,774,776,779,781,785,787,790,793,795,797,800,803,806,809,811,814,817,820,822,825,827],{"class":679,"line":775},5,[677,777,778],{"class":691},"    log",[677,780,662],{"class":687},[677,782,784],{"class":783},"s2Zo4","info",[677,786,745],{"class":741},[677,788,789],{"class":687},"{",[677,791,792],{"class":741}," source",[677,794,752],{"class":687},[677,796,701],{"class":687},[677,798,799],{"class":704},"mylib.client",[677,801,802],{"class":687},"'",[677,804,805],{"class":687},",",[677,807,808],{"class":741}," message",[677,810,752],{"class":687},[677,812,813],{"class":687}," `",[677,815,816],{"class":704},"GET ",[677,818,819],{"class":687},"${",[677,821,749],{"class":691},[677,823,824],{"class":687},"}`",[677,826,695],{"class":687},[677,828,829],{"class":741},")\n",[677,831,833],{"class":679,"line":832},6,[677,834,836],{"class":835},"sHwdD","    \u002F\u002F ...\n",[677,838,840],{"class":679,"line":839},7,[677,841,842],{"class":687},"  }\n",[677,844,846],{"class":679,"line":845},8,[677,847,848],{"class":687},"}\n",[604,850,851],{},"The first segment is your package name and stays stable across releases. Treat it as a public identifier: hosts filter on it.",[622,853,855],{"id":854},"attribute-wide-events-to-your-package","Attribute wide events to your package",[604,857,858,859,862,863,866],{},"When an operation deserves one wide event instead of individual messages, build it with ",[614,860,861],{},"createLogger"," and put the package name in a field the host can query. ",[614,864,865],{},"source"," is a convention, not an API: pick one field name and document it in your package's README.",[667,868,871],{"className":669,"code":869,"filename":870,"language":672,"meta":673,"style":673},"import { createLogger } from 'evlog'\n\nexport function syncRecords(records: number): void {\n  const log = createLogger({ source: 'mylib', operation: 'sync-records' })\n  log.set({ records: { total: records } })\n  \u002F\u002F ...\n  log.emit()\n}\n","src\u002Fsync.ts",[614,872,873,892,896,923,968,1002,1007,1019],{"__ignoreMap":673},[677,874,875,877,879,882,884,886,888,890],{"class":679,"line":680},[677,876,684],{"class":683},[677,878,688],{"class":687},[677,880,881],{"class":691}," createLogger",[677,883,695],{"class":687},[677,885,698],{"class":683},[677,887,701],{"class":687},[677,889,705],{"class":704},[677,891,708],{"class":687},[677,893,894],{"class":679,"line":711},[677,895,715],{"emptyLinePlaceholder":714},[677,897,898,900,903,906,908,911,913,916,918,921],{"class":679,"line":718},[677,899,721],{"class":683},[677,901,902],{"class":724}," function",[677,904,905],{"class":783}," syncRecords",[677,907,745],{"class":687},[677,909,910],{"class":748},"records",[677,912,752],{"class":687},[677,914,915],{"class":728}," number",[677,917,758],{"class":687},[677,919,920],{"class":728}," void",[677,922,732],{"class":687},[677,924,925,928,930,933,935,937,939,941,943,945,948,950,952,955,957,959,962,964,966],{"class":679,"line":735},[677,926,927],{"class":724},"  const",[677,929,692],{"class":691},[677,931,932],{"class":687}," =",[677,934,881],{"class":783},[677,936,745],{"class":741},[677,938,789],{"class":687},[677,940,792],{"class":741},[677,942,752],{"class":687},[677,944,701],{"class":687},[677,946,947],{"class":704},"mylib",[677,949,802],{"class":687},[677,951,805],{"class":687},[677,953,954],{"class":741}," operation",[677,956,752],{"class":687},[677,958,701],{"class":687},[677,960,961],{"class":704},"sync-records",[677,963,802],{"class":687},[677,965,695],{"class":687},[677,967,829],{"class":741},[677,969,970,973,975,978,980,982,985,987,989,992,994,996,998,1000],{"class":679,"line":775},[677,971,972],{"class":691},"  log",[677,974,662],{"class":687},[677,976,977],{"class":783},"set",[677,979,745],{"class":741},[677,981,789],{"class":687},[677,983,984],{"class":741}," records",[677,986,752],{"class":687},[677,988,688],{"class":687},[677,990,991],{"class":741}," total",[677,993,752],{"class":687},[677,995,984],{"class":691},[677,997,695],{"class":687},[677,999,695],{"class":687},[677,1001,829],{"class":741},[677,1003,1004],{"class":679,"line":832},[677,1005,1006],{"class":835},"  \u002F\u002F ...\n",[677,1008,1009,1011,1013,1016],{"class":679,"line":839},[677,1010,972],{"class":691},[677,1012,662],{"class":687},[677,1014,1015],{"class":783},"emit",[677,1017,1018],{"class":741},"()\n",[677,1020,1021],{"class":679,"line":845},[677,1022,848],{"class":687},[604,1024,1025,1026,1029,1030,1033,1034,1036],{},"If your fields benefit from compile-time checking, type the context: ",[614,1027,1028],{},"createLogger\u003CSyncContext>()",". ",[1031,1032,76],"a",{"href":77}," covers the patterns. ",[1031,1035,471],{"href":472}," shows how to assert on the events this produces.",[622,1038,1040],{"id":1039},"join-the-hosts-request-when-you-run-inside-one","Join the host's request when you run inside one",[604,1042,1043],{},"Inside a host application, the framework integration already builds one wide event per request and emits it at the end of the lifecycle. A package that creates its own logger during a request forks that into two unrelated events, and the host loses the connection between its handler and your code. Instead, accept the request logger as a parameter and add your context to the event the host already owns:",[667,1045,1048],{"className":669,"code":1046,"filename":1047,"language":672,"meta":673,"style":673},"import type { AuditableLogger } from 'evlog'\n\nexport function chargePayment(log: AuditableLogger, amount: number): void {\n  log.set({ payment: { amount, provider: 'stripe' } })\n  \u002F\u002F ...\n}\n","src\u002Fcheckout.ts",[614,1049,1050,1072,1076,1108,1149,1153],{"__ignoreMap":673},[677,1051,1052,1054,1057,1059,1062,1064,1066,1068,1070],{"class":679,"line":680},[677,1053,684],{"class":683},[677,1055,1056],{"class":683}," type",[677,1058,688],{"class":687},[677,1060,1061],{"class":691}," AuditableLogger",[677,1063,695],{"class":687},[677,1065,698],{"class":683},[677,1067,701],{"class":687},[677,1069,705],{"class":704},[677,1071,708],{"class":687},[677,1073,1074],{"class":679,"line":711},[677,1075,715],{"emptyLinePlaceholder":714},[677,1077,1078,1080,1082,1085,1087,1089,1091,1093,1095,1098,1100,1102,1104,1106],{"class":679,"line":718},[677,1079,721],{"class":683},[677,1081,902],{"class":724},[677,1083,1084],{"class":783}," chargePayment",[677,1086,745],{"class":687},[677,1088,631],{"class":748},[677,1090,752],{"class":687},[677,1092,1061],{"class":728},[677,1094,805],{"class":687},[677,1096,1097],{"class":748}," amount",[677,1099,752],{"class":687},[677,1101,915],{"class":728},[677,1103,758],{"class":687},[677,1105,920],{"class":728},[677,1107,732],{"class":687},[677,1109,1110,1112,1114,1116,1118,1120,1123,1125,1127,1129,1131,1134,1136,1138,1141,1143,1145,1147],{"class":679,"line":735},[677,1111,972],{"class":691},[677,1113,662],{"class":687},[677,1115,977],{"class":783},[677,1117,745],{"class":741},[677,1119,789],{"class":687},[677,1121,1122],{"class":741}," payment",[677,1124,752],{"class":687},[677,1126,688],{"class":687},[677,1128,1097],{"class":691},[677,1130,805],{"class":687},[677,1132,1133],{"class":741}," provider",[677,1135,752],{"class":687},[677,1137,701],{"class":687},[677,1139,1140],{"class":704},"stripe",[677,1142,802],{"class":687},[677,1144,695],{"class":687},[677,1146,695],{"class":687},[677,1148,829],{"class":741},[677,1150,1151],{"class":679,"line":775},[677,1152,1006],{"class":835},[677,1154,1155],{"class":679,"line":832},[677,1156,848],{"class":687},[604,1158,1159,1160,1163,1164,1167,1168,1171,1172,1175],{},"The host resolves the request logger with ",[614,1161,1162],{},"useLogger()"," from the framework subpath it uses (",[614,1165,1166],{},"evlog\u002Fhono",", ",[614,1169,1170],{},"evlog\u002Fnext",", ...) or with the framework-native accessor, then passes it to your package. Every ",[614,1173,1174],{},"log.set()"," you call merges into the request's wide event, so the host sees the whole operation in one place.",[608,1177,1178,1179,1182,1183,1186],{"color":784,"icon":13},"Request loggers from some framework integrations also carry ",[614,1180,1181],{},"log.fork()"," for background work that needs its own event, correlated with the parent request. Integrations attach it when they run a logger storage (Hono, oRPC, Express, Fastify, NestJS, SvelteKit, React Router, Next.js, Elysia); Nitro and Nuxt do not attach it yet. A standalone ",[614,1184,1185],{},"createLogger()"," instance never has it.",[604,1188,1189,1190,1193],{},"Design your API so the logger stays optional: ",[614,1191,1192],{},"chargePayment(log, amount)"," where the host passes what it has. A package that quietly reaches for an ambient logger cannot run inside a queue worker or a script, and the host has no way to hand you the request logger you skipped.",[622,1195,1197],{"id":1196},"expect-more-than-one-copy-of-evlog-in-the-graph","Expect more than one copy of evlog in the graph",[604,1199,1200,1201,1203],{},"Your package's dependency tree and the host's can resolve different physical copies of evlog, because package managers hash optional peers differently across workspaces. evlog handles the common case for you: every 2.x copy registers the same process-wide slot, so an ",[614,1202,616],{}," from the host's copy configures your copy too, and your emits flow through the host's drains.",[604,1205,1206,1207,1209],{},"Declare ",[614,1208,705],{}," as a peer dependency pinned to a single major to stay inside that guarantee:",[667,1211,1216],{"className":1212,"code":1213,"filename":1214,"language":1215,"meta":673,"style":673},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"peerDependencies\": {\n    \"evlog\": \"^2.0.0\"\n  }\n}\n","package.json","json",[614,1217,1218,1223,1238,1258,1262],{"__ignoreMap":673},[677,1219,1220],{"class":679,"line":680},[677,1221,1222],{"class":687},"{\n",[677,1224,1225,1228,1231,1234,1236],{"class":679,"line":711},[677,1226,1227],{"class":687},"  \"",[677,1229,1230],{"class":724},"peerDependencies",[677,1232,1233],{"class":687},"\"",[677,1235,752],{"class":687},[677,1237,732],{"class":687},[677,1239,1240,1243,1245,1247,1249,1252,1255],{"class":679,"line":718},[677,1241,1242],{"class":687},"    \"",[677,1244,705],{"class":728},[677,1246,1233],{"class":687},[677,1248,752],{"class":687},[677,1250,1251],{"class":687}," \"",[677,1253,1254],{"class":704},"^2.0.0",[677,1256,1257],{"class":687},"\"\n",[677,1259,1260],{"class":679,"line":735},[677,1261,842],{"class":687},[677,1263,1264],{"class":679,"line":775},[677,1265,848],{"class":687},[604,1267,1268],{},"Two different majors in one process is the case evlog can't fix: they can't share request scope or configuration, so events emitted through the other copy are undrained and unredacted, and evlog prints a warning when the second major registers. Deduplicate the graph to a single major when that warning appears; nothing in your package code needs to change.",[604,1270,1271,1272,662],{},"For errors, duplicate copies have a second consequence on how the host should catch yours, covered in ",[1031,1273,56],{"href":468},[1275,1276,1277],"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 pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}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 .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}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 .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);}",{"title":673,"searchDepth":711,"depth":711,"links":1279},[1280,1281,1282,1283],{"id":624,"depth":711,"text":625},{"id":854,"depth":711,"text":855},{"id":1039,"depth":711,"text":1040},{"id":1196,"depth":711,"text":1197},"Emit events from library code the host can attribute and filter: the global log API, source fields, request participation, and duplicate installs.","md",null,{},{"title":463,"icon":466},{"title":463,"description":1284},"HHkj9lpSzN4tCDuZW4MBxE9tYz7fyLVRr19n0L62xJk",[1292,1294],{"title":41,"path":459,"stem":460,"description":1293,"icon":461,"children":-1},"Ship evlog inside a reusable package: legible events and errors in every host application that runs it, without owning any logging configuration.",{"title":56,"path":468,"stem":469,"description":1295,"icon":59,"children":-1},"Replace bare errors with a catalog your package owns: typed factories, a collision-free wire format, and codes the host can act on.",1789076918104]