[{"data":1,"prerenderedAt":1377},["ShallowReactive",2],{"navigation_docs":3,"-logging-audit-schema":427,"-logging-audit-schema-surround":1372},[4,35,159,201,289,324,411],{"title":5,"path":6,"stem":7,"children":8,"page":34},"Getting Started","\u002Fgetting-started","1.getting-started",[9,14,19,24,29],{"title":10,"path":11,"stem":12,"icon":13},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction","i-lucide-info",{"title":15,"path":16,"stem":17,"icon":18},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation","i-lucide-download",{"title":20,"path":21,"stem":22,"icon":23},"Quick Start","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start","i-lucide-zap",{"title":25,"path":26,"stem":27,"icon":28},"Agent Skills","\u002Fgetting-started\u002Fagent-skills","1.getting-started\u002F4.agent-skills","i-lucide-sparkles",{"title":30,"path":31,"stem":32,"icon":33},"vs Other Loggers","\u002Fgetting-started\u002Fvs-other-loggers","1.getting-started\u002F5.vs-other-loggers","i-lucide-scale",false,{"title":36,"path":37,"stem":38,"children":39,"page":34},"Logging","\u002Flogging","2.logging",[40,45,50,55,60,65,70,99,127],{"title":41,"path":42,"stem":43,"icon":44},"Overview","\u002Flogging\u002Foverview","2.logging\u002F0.overview","i-lucide-list",{"title":46,"path":47,"stem":48,"icon":49},"Simple Logging","\u002Flogging\u002Fsimple-logging","2.logging\u002F1.simple-logging","i-lucide-terminal",{"title":51,"path":52,"stem":53,"icon":54},"Wide Events","\u002Flogging\u002Fwide-events","2.logging\u002F2.wide-events","i-lucide-layers",{"title":56,"path":57,"stem":58,"icon":59},"Structured Errors","\u002Flogging\u002Fstructured-errors","2.logging\u002F3.structured-errors","i-lucide-shield-alert",{"title":61,"path":62,"stem":63,"icon":64},"Catalogs","\u002Flogging\u002Fcatalogs","2.logging\u002F4.catalogs","i-lucide-book-open",{"title":66,"path":67,"stem":68,"icon":69},"Client Logging","\u002Flogging\u002Fclient-logging","2.logging\u002F5.client-logging","i-lucide-monitor",{"title":71,"icon":72,"path":73,"stem":74,"children":75,"page":34},"AI SDK","i-simple-icons-vercel","\u002Flogging\u002Fai-sdk","2.logging\u002F6.ai-sdk",[76,79,84,89,94],{"title":41,"path":77,"stem":78,"icon":44},"\u002Flogging\u002Fai-sdk\u002Foverview","2.logging\u002F6.ai-sdk\u002F01.overview",{"title":80,"path":81,"stem":82,"icon":83},"Usage","\u002Flogging\u002Fai-sdk\u002Fusage","2.logging\u002F6.ai-sdk\u002F02.usage","i-lucide-code",{"title":85,"path":86,"stem":87,"icon":88},"Options","\u002Flogging\u002Fai-sdk\u002Foptions","2.logging\u002F6.ai-sdk\u002F03.options","i-lucide-sliders",{"title":90,"path":91,"stem":92,"icon":93},"Metadata","\u002Flogging\u002Fai-sdk\u002Fmetadata","2.logging\u002F6.ai-sdk\u002F04.metadata","i-lucide-database",{"title":95,"path":96,"stem":97,"icon":98},"Telemetry","\u002Flogging\u002Fai-sdk\u002Ftelemetry","2.logging\u002F6.ai-sdk\u002F05.telemetry","i-lucide-activity",{"title":100,"icon":101,"path":102,"stem":103,"children":104,"page":34},"Better Auth","i-simple-icons-betterauth","\u002Flogging\u002Fbetter-auth","2.logging\u002F7.better-auth",[105,108,113,118,122],{"title":41,"path":106,"stem":107,"icon":44},"\u002Flogging\u002Fbetter-auth\u002Foverview","2.logging\u002F7.better-auth\u002F01.overview",{"title":109,"path":110,"stem":111,"icon":112},"Identify User","\u002Flogging\u002Fbetter-auth\u002Fidentify-user","2.logging\u002F7.better-auth\u002F02.identify-user","i-lucide-user-check",{"title":114,"path":115,"stem":116,"icon":117},"Middleware","\u002Flogging\u002Fbetter-auth\u002Fmiddleware","2.logging\u002F7.better-auth\u002F03.middleware","i-lucide-shield",{"title":119,"path":120,"stem":121,"icon":69},"Client Sync","\u002Flogging\u002Fbetter-auth\u002Fclient-sync","2.logging\u002F7.better-auth\u002F04.client-sync",{"title":123,"path":124,"stem":125,"icon":126},"Performance","\u002Flogging\u002Fbetter-auth\u002Fperformance","2.logging\u002F7.better-auth\u002F05.performance","i-lucide-gauge",{"title":128,"icon":129,"path":130,"stem":131,"children":132,"page":34},"Audit Logs","i-lucide-shield-check","\u002Flogging\u002Faudit","2.logging\u002F8.audit",[133,136,141,146,151,155],{"title":41,"path":134,"stem":135,"icon":44},"\u002Flogging\u002Faudit\u002Foverview","2.logging\u002F8.audit\u002F01.overview",{"title":137,"path":138,"stem":139,"icon":140},"Schema","\u002Flogging\u002Faudit\u002Fschema","2.logging\u002F8.audit\u002F02.schema","i-lucide-file-text",{"title":142,"path":143,"stem":144,"icon":145},"Recording","\u002Flogging\u002Faudit\u002Frecording","2.logging\u002F8.audit\u002F03.recording","i-lucide-pen-line",{"title":147,"path":148,"stem":149,"icon":150},"Drains","\u002Flogging\u002Faudit\u002Fpipeline","2.logging\u002F8.audit\u002F04.pipeline","i-lucide-link",{"title":152,"path":153,"stem":154,"icon":129},"Compliance","\u002Flogging\u002Faudit\u002Fcompliance","2.logging\u002F8.audit\u002F05.compliance",{"title":156,"path":157,"stem":158,"icon":64},"Recipes","\u002Flogging\u002Faudit\u002Frecipes","2.logging\u002F8.audit\u002F06.recipes",{"title":160,"path":161,"stem":162,"children":163,"page":34},"Core Concepts","\u002Fcore-concepts","3.core-concepts",[164,169,174,179,184,188,191,196],{"title":165,"path":166,"stem":167,"icon":168},"Lifecycle","\u002Fcore-concepts\u002Flifecycle","3.core-concepts\u002F0.lifecycle","i-lucide-arrow-right-left",{"title":170,"path":171,"stem":172,"icon":173},"Configuration","\u002Fcore-concepts\u002Fconfiguration","3.core-concepts\u002F1.configuration","i-lucide-settings",{"title":175,"path":176,"stem":177,"icon":178},"Sampling","\u002Fcore-concepts\u002Fsampling","3.core-concepts\u002F2.sampling","i-lucide-filter",{"title":180,"path":181,"stem":182,"icon":183},"Typed Fields","\u002Fcore-concepts\u002Ftyped-fields","3.core-concepts\u002F3.typed-fields","i-simple-icons-typescript",{"title":185,"path":186,"stem":187,"icon":129},"Best Practices","\u002Fcore-concepts\u002Fbest-practices","3.core-concepts\u002F4.best-practices",{"title":123,"path":189,"stem":190,"icon":126},"\u002Fcore-concepts\u002Fperformance","3.core-concepts\u002F5.performance",{"title":192,"path":193,"stem":194,"icon":195},"Vite Plugin","\u002Fcore-concepts\u002Fvite-plugin","3.core-concepts\u002F6.vite-plugin","i-custom-vite",{"title":197,"path":198,"stem":199,"icon":200},"Auto-Redaction","\u002Fcore-concepts\u002Fredaction","3.core-concepts\u002F7.redaction","i-lucide-eye-off",{"title":202,"path":203,"stem":204,"children":205,"page":34},"Frameworks","\u002Fframeworks","4.frameworks",[206,210,215,220,225,230,235,240,245,250,255,260,265,270,274,279,284],{"title":41,"path":207,"stem":208,"icon":209},"\u002Fframeworks\u002Foverview","4.frameworks\u002F00.overview","i-lucide-layout-grid",{"title":211,"path":212,"stem":213,"icon":214},"Nuxt","\u002Fframeworks\u002Fnuxt","4.frameworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":216,"path":217,"stem":218,"icon":219},"Next.js","\u002Fframeworks\u002Fnextjs","4.frameworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":221,"path":222,"stem":223,"icon":224},"SvelteKit","\u002Fframeworks\u002Fsveltekit","4.frameworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":226,"path":227,"stem":228,"icon":229},"Nitro","\u002Fframeworks\u002Fnitro","4.frameworks\u002F04.nitro","i-custom-nitro",{"title":231,"path":232,"stem":233,"icon":234},"TanStack Start","\u002Fframeworks\u002Ftanstack-start","4.frameworks\u002F05.tanstack-start","i-custom-tanstack",{"title":236,"path":237,"stem":238,"icon":239},"NestJS","\u002Fframeworks\u002Fnestjs","4.frameworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":241,"path":242,"stem":243,"icon":244},"Express","\u002Fframeworks\u002Fexpress","4.frameworks\u002F07.express","i-simple-icons-express",{"title":246,"path":247,"stem":248,"icon":249},"Hono","\u002Fframeworks\u002Fhono","4.frameworks\u002F08.hono","i-simple-icons-hono",{"title":251,"path":252,"stem":253,"icon":254},"Fastify","\u002Fframeworks\u002Ffastify","4.frameworks\u002F09.fastify","i-simple-icons-fastify",{"title":256,"path":257,"stem":258,"icon":259},"Elysia","\u002Fframeworks\u002Felysia","4.frameworks\u002F10.elysia","i-custom-elysia",{"title":261,"path":262,"stem":263,"icon":264},"React Router","\u002Fframeworks\u002Freact-router","4.frameworks\u002F11.react-router","i-custom-reactrouter",{"title":266,"path":267,"stem":268,"icon":269},"Cloudflare Workers","\u002Fframeworks\u002Fcloudflare-workers","4.frameworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":271,"path":272,"stem":273,"icon":183},"Standalone","\u002Fframeworks\u002Fstandalone","4.frameworks\u002F13.standalone",{"title":275,"path":276,"stem":277,"icon":278},"Astro","\u002Fframeworks\u002Fastro","4.frameworks\u002F14.astro","i-simple-icons-astro",{"title":280,"path":281,"stem":282,"icon":283},"AWS Lambda","\u002Fframeworks\u002Faws-lambda","4.frameworks\u002F16.aws-lambda","i-custom-lambda",{"title":285,"path":286,"stem":287,"icon":288},"Custom Integration","\u002Fframeworks\u002Fcustom-integration","4.frameworks\u002F17.custom-integration","i-lucide-puzzle",{"title":290,"path":291,"stem":292,"children":293,"page":34},"Build on top","\u002Fbuild-on-top","5.build-on-top",[294,297,302,307,311,315,320],{"title":41,"path":295,"stem":296,"icon":54},"\u002Fbuild-on-top\u002Foverview","5.build-on-top\u002F0.overview",{"title":298,"path":299,"stem":300,"icon":301},"Stream","\u002Fbuild-on-top\u002Fstream","5.build-on-top\u002F1.stream","i-lucide-radio-tower",{"title":303,"path":304,"stem":305,"icon":306},"FS reader","\u002Fbuild-on-top\u002Ffs-reader","5.build-on-top\u002F2.fs-reader","i-lucide-folder-search",{"title":156,"path":308,"stem":309,"icon":310},"\u002Fbuild-on-top\u002Fconsumer-recipes","5.build-on-top\u002F3.consumer-recipes","i-lucide-chef-hat",{"title":312,"path":313,"stem":314,"icon":288},"Pipeline extension","\u002Fbuild-on-top\u002Fpipeline-extension","5.build-on-top\u002F4.pipeline-extension",{"title":316,"path":317,"stem":318,"icon":319},"Sinks","\u002Fbuild-on-top\u002Fsinks","5.build-on-top\u002F5.sinks","i-lucide-share-2",{"title":321,"path":322,"stem":323,"icon":288},"Framework integration","\u002Fbuild-on-top\u002Fframework-integration","5.build-on-top\u002F6.framework-integration",{"title":325,"path":326,"stem":327,"children":328,"page":34},"Adapters","\u002Fadapters","6.adapters",[329,332,372,387],{"title":41,"path":330,"stem":331,"icon":44},"\u002Fadapters\u002Foverview","6.adapters\u002F01.overview",{"title":333,"path":334,"stem":335,"children":336,"page":34},"Cloud destinations","\u002Fadapters\u002Fcloud","6.adapters\u002F02.cloud",[337,342,347,352,357,362,367],{"title":338,"path":339,"stem":340,"icon":341},"Axiom","\u002Fadapters\u002Fcloud\u002Faxiom","6.adapters\u002F02.cloud\u002F01.axiom","i-custom-axiom",{"title":343,"path":344,"stem":345,"icon":346},"OTLP","\u002Fadapters\u002Fcloud\u002Fotlp","6.adapters\u002F02.cloud\u002F02.otlp","i-simple-icons-opentelemetry",{"title":348,"path":349,"stem":350,"icon":351},"PostHog","\u002Fadapters\u002Fcloud\u002Fposthog","6.adapters\u002F02.cloud\u002F03.posthog","i-simple-icons-posthog",{"title":353,"path":354,"stem":355,"icon":356},"Sentry","\u002Fadapters\u002Fcloud\u002Fsentry","6.adapters\u002F02.cloud\u002F04.sentry","i-simple-icons-sentry",{"title":358,"path":359,"stem":360,"icon":361},"Better Stack","\u002Fadapters\u002Fcloud\u002Fbetter-stack","6.adapters\u002F02.cloud\u002F05.better-stack","i-simple-icons-betterstack",{"title":363,"path":364,"stem":365,"icon":366},"Datadog","\u002Fadapters\u002Fcloud\u002Fdatadog","6.adapters\u002F02.cloud\u002F06.datadog","i-simple-icons-datadog",{"title":368,"path":369,"stem":370,"icon":371},"HyperDX","\u002Fadapters\u002Fcloud\u002Fhyperdx","6.adapters\u002F02.cloud\u002F07.hyperdx","i-custom-hyperdx",{"title":373,"path":374,"stem":375,"children":376,"page":34},"Self-hosted","\u002Fadapters\u002Fself-hosted","6.adapters\u002F03.self-hosted",[377,382],{"title":378,"path":379,"stem":380,"icon":381},"File System","\u002Fadapters\u002Fself-hosted\u002Ffs","6.adapters\u002F03.self-hosted\u002F01.fs","i-lucide-hard-drive",{"title":383,"path":384,"stem":385,"icon":386},"NuxtHub","\u002Fadapters\u002Fself-hosted\u002Fnuxthub","6.adapters\u002F03.self-hosted\u002F02.nuxthub","i-simple-icons-nuxt",{"title":388,"path":389,"stem":390,"children":391,"page":34},"Building blocks","\u002Fadapters\u002Fbuilding-blocks","6.adapters\u002F04.building-blocks",[392,397,402,406],{"title":393,"path":394,"stem":395,"icon":396},"Pipeline","\u002Fadapters\u002Fbuilding-blocks\u002Fpipeline","6.adapters\u002F04.building-blocks\u002F01.pipeline","i-lucide-workflow",{"title":398,"path":399,"stem":400,"icon":401},"HTTP","\u002Fadapters\u002Fbuilding-blocks\u002Fhttp","6.adapters\u002F04.building-blocks\u002F02.http","i-lucide-globe",{"title":403,"path":404,"stem":405,"icon":83},"Custom Adapters","\u002Fadapters\u002Fbuilding-blocks\u002Fcustom","6.adapters\u002F04.building-blocks\u002F03.custom",{"title":407,"path":408,"stem":409,"icon":410},"Toolkit","\u002Fadapters\u002Fbuilding-blocks\u002Ftoolkit","6.adapters\u002F04.building-blocks\u002F04.toolkit","i-lucide-blocks",{"title":412,"path":413,"stem":414,"children":415,"page":34},"Enrichers","\u002Fenrichers","7.enrichers",[416,419,423],{"title":41,"path":417,"stem":418,"icon":28},"\u002Fenrichers\u002Foverview","7.enrichers\u002F1.overview",{"title":420,"path":421,"stem":422,"icon":288},"Built-in","\u002Fenrichers\u002Fbuilt-in","7.enrichers\u002F2.built-in",{"title":424,"path":425,"stem":426,"icon":83},"Custom","\u002Fenrichers\u002Fcustom","7.enrichers\u002F3.custom",{"id":428,"title":429,"body":430,"description":1361,"extension":1362,"links":1363,"meta":1368,"navigation":1369,"path":138,"seo":1370,"stem":139,"__hash__":1371},"docs\u002F2.logging\u002F8.audit\u002F02.schema.md","Audit Schema",{"type":431,"value":432,"toc":1352},"minimark",[433,445,453,926,930,968,971,1083,1101,1105,1127,1202,1206,1252,1264,1268,1286,1289,1293,1335,1348],[434,435,436,440,441,444],"p",{},[437,438,439],"code",{},"event.audit"," is a typed field on every wide event. Downstream queries filter on ",[437,442,443],{},"audit IS NOT NULL"," to materialise an audit dataset out of regular logs.",[446,447,449,452],"h2",{"id":448},"auditfields-type",[437,450,451],{},"AuditFields"," type",[454,455,460],"pre",{"className":456,"code":457,"language":458,"meta":459,"style":459},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","interface AuditFields {\n  action: string                          \u002F\u002F 'invoice.refund'\n  actor: {\n    type: 'user' | 'system' | 'api' | 'agent'\n    id: string\n    displayName?: string\n    email?: string\n    \u002F\u002F For type === 'agent', mirrors evlog\u002Fai fields:\n    model?: string\n    tools?: string[]\n    reason?: string\n    promptId?: string\n  }\n  target?: { type: string, id: string, [k: string]: unknown }\n  outcome: 'success' | 'failure' | 'denied'\n  reason?: string\n  changes?: { before?: unknown, after?: unknown }\n  causationId?: string                    \u002F\u002F ID of the action that caused this one\n  correlationId?: string                  \u002F\u002F Shared by every action in one operation\n  version?: number                        \u002F\u002F Defaults to 1\n  idempotencyKey?: string                 \u002F\u002F Auto-derived; safe retries across drains\n  context?: {                             \u002F\u002F Filled by auditEnricher\n    requestId?: string\n    traceId?: string\n    ip?: string\n    userAgent?: string\n    tenantId?: string\n  }\n  signature?: string                      \u002F\u002F Set by signed({ strategy: 'hmac' })\n  prevHash?: string                       \u002F\u002F Set by signed({ strategy: 'hash-chain' })\n  hash?: string\n}\n","typescript","",[437,461,462,479,496,506,553,564,575,585,591,601,615,625,635,641,692,725,735,763,776,789,803,816,829,839,849,859,869,879,884,897,910,920],{"__ignoreMap":459},[463,464,467,471,475],"span",{"class":465,"line":466},"line",1,[463,468,470],{"class":469},"spNyl","interface",[463,472,474],{"class":473},"sBMFI"," AuditFields",[463,476,478],{"class":477},"sMK4o"," {\n",[463,480,482,486,489,492],{"class":465,"line":481},2,[463,483,485],{"class":484},"swJcz","  action",[463,487,488],{"class":477},":",[463,490,491],{"class":473}," string",[463,493,495],{"class":494},"sHwdD","                          \u002F\u002F 'invoice.refund'\n",[463,497,499,502,504],{"class":465,"line":498},3,[463,500,501],{"class":484},"  actor",[463,503,488],{"class":477},[463,505,478],{"class":477},[463,507,509,512,514,517,521,524,527,529,532,534,536,538,541,543,545,547,550],{"class":465,"line":508},4,[463,510,511],{"class":484},"    type",[463,513,488],{"class":477},[463,515,516],{"class":477}," '",[463,518,520],{"class":519},"sfazB","user",[463,522,523],{"class":477},"'",[463,525,526],{"class":477}," |",[463,528,516],{"class":477},[463,530,531],{"class":519},"system",[463,533,523],{"class":477},[463,535,526],{"class":477},[463,537,516],{"class":477},[463,539,540],{"class":519},"api",[463,542,523],{"class":477},[463,544,526],{"class":477},[463,546,516],{"class":477},[463,548,549],{"class":519},"agent",[463,551,552],{"class":477},"'\n",[463,554,556,559,561],{"class":465,"line":555},5,[463,557,558],{"class":484},"    id",[463,560,488],{"class":477},[463,562,563],{"class":473}," string\n",[463,565,567,570,573],{"class":465,"line":566},6,[463,568,569],{"class":484},"    displayName",[463,571,572],{"class":477},"?:",[463,574,563],{"class":473},[463,576,578,581,583],{"class":465,"line":577},7,[463,579,580],{"class":484},"    email",[463,582,572],{"class":477},[463,584,563],{"class":473},[463,586,588],{"class":465,"line":587},8,[463,589,590],{"class":494},"    \u002F\u002F For type === 'agent', mirrors evlog\u002Fai fields:\n",[463,592,594,597,599],{"class":465,"line":593},9,[463,595,596],{"class":484},"    model",[463,598,572],{"class":477},[463,600,563],{"class":473},[463,602,604,607,609,611],{"class":465,"line":603},10,[463,605,606],{"class":484},"    tools",[463,608,572],{"class":477},[463,610,491],{"class":473},[463,612,614],{"class":613},"sTEyZ","[]\n",[463,616,618,621,623],{"class":465,"line":617},11,[463,619,620],{"class":484},"    reason",[463,622,572],{"class":477},[463,624,563],{"class":473},[463,626,628,631,633],{"class":465,"line":627},12,[463,629,630],{"class":484},"    promptId",[463,632,572],{"class":477},[463,634,563],{"class":473},[463,636,638],{"class":465,"line":637},13,[463,639,640],{"class":477},"  }\n",[463,642,644,647,649,652,654,656,658,661,664,666,668,670,673,677,679,681,684,686,689],{"class":465,"line":643},14,[463,645,646],{"class":484},"  target",[463,648,572],{"class":477},[463,650,651],{"class":477}," {",[463,653,452],{"class":484},[463,655,488],{"class":477},[463,657,491],{"class":473},[463,659,660],{"class":477},",",[463,662,663],{"class":484}," id",[463,665,488],{"class":477},[463,667,491],{"class":473},[463,669,660],{"class":477},[463,671,672],{"class":613}," [",[463,674,676],{"class":675},"sHdIc","k",[463,678,488],{"class":477},[463,680,491],{"class":473},[463,682,683],{"class":613},"]",[463,685,488],{"class":477},[463,687,688],{"class":473}," unknown",[463,690,691],{"class":477}," }\n",[463,693,695,698,700,702,705,707,709,711,714,716,718,720,723],{"class":465,"line":694},15,[463,696,697],{"class":484},"  outcome",[463,699,488],{"class":477},[463,701,516],{"class":477},[463,703,704],{"class":519},"success",[463,706,523],{"class":477},[463,708,526],{"class":477},[463,710,516],{"class":477},[463,712,713],{"class":519},"failure",[463,715,523],{"class":477},[463,717,526],{"class":477},[463,719,516],{"class":477},[463,721,722],{"class":519},"denied",[463,724,552],{"class":477},[463,726,728,731,733],{"class":465,"line":727},16,[463,729,730],{"class":484},"  reason",[463,732,572],{"class":477},[463,734,563],{"class":473},[463,736,738,741,743,745,748,750,752,754,757,759,761],{"class":465,"line":737},17,[463,739,740],{"class":484},"  changes",[463,742,572],{"class":477},[463,744,651],{"class":477},[463,746,747],{"class":484}," before",[463,749,572],{"class":477},[463,751,688],{"class":473},[463,753,660],{"class":477},[463,755,756],{"class":484}," after",[463,758,572],{"class":477},[463,760,688],{"class":473},[463,762,691],{"class":477},[463,764,766,769,771,773],{"class":465,"line":765},18,[463,767,768],{"class":484},"  causationId",[463,770,572],{"class":477},[463,772,491],{"class":473},[463,774,775],{"class":494},"                    \u002F\u002F ID of the action that caused this one\n",[463,777,779,782,784,786],{"class":465,"line":778},19,[463,780,781],{"class":484},"  correlationId",[463,783,572],{"class":477},[463,785,491],{"class":473},[463,787,788],{"class":494},"                  \u002F\u002F Shared by every action in one operation\n",[463,790,792,795,797,800],{"class":465,"line":791},20,[463,793,794],{"class":484},"  version",[463,796,572],{"class":477},[463,798,799],{"class":473}," number",[463,801,802],{"class":494},"                        \u002F\u002F Defaults to 1\n",[463,804,806,809,811,813],{"class":465,"line":805},21,[463,807,808],{"class":484},"  idempotencyKey",[463,810,572],{"class":477},[463,812,491],{"class":473},[463,814,815],{"class":494},"                 \u002F\u002F Auto-derived; safe retries across drains\n",[463,817,819,822,824,826],{"class":465,"line":818},22,[463,820,821],{"class":484},"  context",[463,823,572],{"class":477},[463,825,651],{"class":477},[463,827,828],{"class":494},"                             \u002F\u002F Filled by auditEnricher\n",[463,830,832,835,837],{"class":465,"line":831},23,[463,833,834],{"class":484},"    requestId",[463,836,572],{"class":477},[463,838,563],{"class":473},[463,840,842,845,847],{"class":465,"line":841},24,[463,843,844],{"class":484},"    traceId",[463,846,572],{"class":477},[463,848,563],{"class":473},[463,850,852,855,857],{"class":465,"line":851},25,[463,853,854],{"class":484},"    ip",[463,856,572],{"class":477},[463,858,563],{"class":473},[463,860,862,865,867],{"class":465,"line":861},26,[463,863,864],{"class":484},"    userAgent",[463,866,572],{"class":477},[463,868,563],{"class":473},[463,870,872,875,877],{"class":465,"line":871},27,[463,873,874],{"class":484},"    tenantId",[463,876,572],{"class":477},[463,878,563],{"class":473},[463,880,882],{"class":465,"line":881},28,[463,883,640],{"class":477},[463,885,887,890,892,894],{"class":465,"line":886},29,[463,888,889],{"class":484},"  signature",[463,891,572],{"class":477},[463,893,491],{"class":473},[463,895,896],{"class":494},"                      \u002F\u002F Set by signed({ strategy: 'hmac' })\n",[463,898,900,903,905,907],{"class":465,"line":899},30,[463,901,902],{"class":484},"  prevHash",[463,904,572],{"class":477},[463,906,491],{"class":473},[463,908,909],{"class":494},"                       \u002F\u002F Set by signed({ strategy: 'hash-chain' })\n",[463,911,913,916,918],{"class":465,"line":912},31,[463,914,915],{"class":484},"  hash",[463,917,572],{"class":477},[463,919,563],{"class":473},[463,921,923],{"class":465,"line":922},32,[463,924,925],{"class":477},"}\n",[446,927,929],{"id":928},"action-naming","Action naming",[931,932,933,941,942,945,946,949,950,949,953,956,957,960,961,964,965,967],"tip",{},[934,935,936,937,940],"strong",{},"Naming convention for ",[437,938,939],{},"action","."," Use ",[437,943,944],{},"noun.verb"," (",[437,947,948],{},"invoice.refund",", ",[437,951,952],{},"user.invite",[437,954,955],{},"apiKey.revoke","). Past tense if the action already happened (",[437,958,959],{},"invoice.refunded","), present tense if ",[437,962,963],{},"withAudit()"," will resolve the outcome. Keep a small fixed dictionary in one file — auditors and SIEM rules query on ",[437,966,939],{},", so a typo is a missing alert.",[434,969,970],{},"A single dictionary file makes alerting straightforward:",[454,972,975],{"className":456,"code":973,"filename":974,"language":458,"meta":459,"style":459},"export const AUDIT_ACTIONS = {\n  USER_INVITE: 'user.invite',\n  USER_REMOVE: 'user.remove',\n  USER_ROLE_CHANGE: 'user.role-change',\n  INVOICE_REFUND: 'invoice.refund',\n  API_KEY_REVOKE: 'apiKey.revoke',\n} as const\n","src\u002Faudit\u002Factions.ts",[437,976,977,994,1010,1026,1042,1057,1072],{"__ignoreMap":459},[463,978,979,983,986,989,992],{"class":465,"line":466},[463,980,982],{"class":981},"s7zQu","export",[463,984,985],{"class":469}," const",[463,987,988],{"class":613}," AUDIT_ACTIONS ",[463,990,991],{"class":477},"=",[463,993,478],{"class":477},[463,995,996,999,1001,1003,1005,1007],{"class":465,"line":481},[463,997,998],{"class":484},"  USER_INVITE",[463,1000,488],{"class":477},[463,1002,516],{"class":477},[463,1004,952],{"class":519},[463,1006,523],{"class":477},[463,1008,1009],{"class":477},",\n",[463,1011,1012,1015,1017,1019,1022,1024],{"class":465,"line":498},[463,1013,1014],{"class":484},"  USER_REMOVE",[463,1016,488],{"class":477},[463,1018,516],{"class":477},[463,1020,1021],{"class":519},"user.remove",[463,1023,523],{"class":477},[463,1025,1009],{"class":477},[463,1027,1028,1031,1033,1035,1038,1040],{"class":465,"line":508},[463,1029,1030],{"class":484},"  USER_ROLE_CHANGE",[463,1032,488],{"class":477},[463,1034,516],{"class":477},[463,1036,1037],{"class":519},"user.role-change",[463,1039,523],{"class":477},[463,1041,1009],{"class":477},[463,1043,1044,1047,1049,1051,1053,1055],{"class":465,"line":555},[463,1045,1046],{"class":484},"  INVOICE_REFUND",[463,1048,488],{"class":477},[463,1050,516],{"class":477},[463,1052,948],{"class":519},[463,1054,523],{"class":477},[463,1056,1009],{"class":477},[463,1058,1059,1062,1064,1066,1068,1070],{"class":465,"line":566},[463,1060,1061],{"class":484},"  API_KEY_REVOKE",[463,1063,488],{"class":477},[463,1065,516],{"class":477},[463,1067,955],{"class":519},[463,1069,523],{"class":477},[463,1071,1009],{"class":477},[463,1073,1074,1077,1080],{"class":465,"line":577},[463,1075,1076],{"class":477},"}",[463,1078,1079],{"class":981}," as",[463,1081,1082],{"class":469}," const\n",[931,1084,1085,1086,1093,1094,1096,1097,1100],{},"For more than a handful of actions, prefer ",[1087,1088,1090],"a",{"href":1089},"\u002Flogging\u002Faudit\u002Frecording#defineauditcatalog",[437,1091,1092],{},"defineAuditCatalog"," over a plain object dictionary — same ",[437,1095,944],{}," convention, but you get autocomplete on the action union and per-entry ",[437,1098,1099],{},"target"," type inference for free.",[446,1102,1104],{"id":1103},"actor-types","Actor types",[1106,1107,1108,941,1111,1114,1115,1118,1119,1122,1123,1126],"warning",{},[934,1109,1110],{},"Don't fake the actor.",[437,1112,1113],{},"actor.type: 'system'"," for cron jobs, queue workers, and background tasks; ",[437,1116,1117],{},"actor.type: 'api'"," for machine-to-machine calls authenticated by a token; ",[437,1120,1121],{},"actor.type: 'agent'"," for AI tool calls. Logging a synthetic ",[437,1124,1125],{},"'user'"," for system actions is the single fastest way to fail an audit review.",[1128,1129,1130,1145],"table",{},[1131,1132,1133],"thead",{},[1134,1135,1136,1142],"tr",{},[1137,1138,1139],"th",{},[437,1140,1141],{},"actor.type",[1137,1143,1144],{},"When to use",[1146,1147,1148,1158,1168,1178],"tbody",{},[1134,1149,1150,1155],{},[1151,1152,1153],"td",{},[437,1154,1125],{},[1151,1156,1157],{},"A human authenticated through your normal auth flow.",[1134,1159,1160,1165],{},[1151,1161,1162],{},[437,1163,1164],{},"'system'",[1151,1166,1167],{},"Cron jobs, queue workers, scheduled tasks, internal background processes.",[1134,1169,1170,1175],{},[1151,1171,1172],{},[437,1173,1174],{},"'api'",[1151,1176,1177],{},"Machine-to-machine calls from another service authenticated by a token.",[1134,1179,1180,1185],{},[1151,1181,1182],{},[437,1183,1184],{},"'agent'",[1151,1186,1187,1188,1191,1192,949,1195,949,1198,1201],{},"AI tool calls (combine with ",[437,1189,1190],{},"evlog\u002Fai"," fields like ",[437,1193,1194],{},"model",[437,1196,1197],{},"tools",[437,1199,1200],{},"promptId",").",[446,1203,1205],{"id":1204},"outcomes","Outcomes",[1128,1207,1208,1220],{},[1131,1209,1210],{},[1134,1211,1212,1217],{},[1137,1213,1214],{},[437,1215,1216],{},"outcome",[1137,1218,1219],{},"Meaning",[1146,1221,1222,1232,1242],{},[1134,1223,1224,1229],{},[1151,1225,1226],{},[437,1227,1228],{},"'success'",[1151,1230,1231],{},"The action completed as requested.",[1134,1233,1234,1239],{},[1151,1235,1236],{},[437,1237,1238],{},"'failure'",[1151,1240,1241],{},"The action was attempted but failed (downstream error, race condition, etc.).",[1134,1243,1244,1249],{},[1151,1245,1246],{},[437,1247,1248],{},"'denied'",[1151,1250,1251],{},"The action was rejected by an authorisation check.",[434,1253,1254,1256,1257,1259,1260,1201],{},[437,1255,1238],{}," and ",[437,1258,1248],{}," are different things — auditors care a lot about denied actions because they signal probing or misconfigured access controls. Always log denials (see ",[1087,1261,1263],{"href":1262},"\u002Flogging\u002Faudit\u002Frecording#deny","Recording Events",[446,1265,1267],{"id":1266},"idempotency","Idempotency",[434,1269,1270,1273,1274,949,1276,949,1279,1281,1282,1285],{},[437,1271,1272],{},"idempotencyKey"," is auto-derived from a hash of ",[437,1275,939],{},[437,1277,1278],{},"actor.id",[437,1280,1099],{},", and a coarse timestamp. The result: even if your drain retries an audit insert across a network blip, the duplicate row collapses on ",[437,1283,1284],{},"ON CONFLICT DO NOTHING",". You don't have to think about it — it's filled in for you.",[434,1287,1288],{},"Use the field as the primary key in Postgres \u002F Bigtable \u002F DynamoDB so retries stay safe by construction.",[446,1290,1292],{"id":1291},"causation-and-correlation","Causation and correlation",[1128,1294,1295,1305],{},[1131,1296,1297],{},[1134,1298,1299,1302],{},[1137,1300,1301],{},"Field",[1137,1303,1304],{},"Use case",[1146,1306,1307,1321],{},[1134,1308,1309,1314],{},[1151,1310,1311],{},[437,1312,1313],{},"correlationId",[1151,1315,1316,1317,1320],{},"Shared by every audit event that belongs to the ",[934,1318,1319],{},"same operation"," (e.g. one HTTP request that triggers a refund + an email + a webhook).",[1134,1322,1323,1328],{},[1151,1324,1325],{},[437,1326,1327],{},"causationId",[1151,1329,1330,1331,1334],{},"The id of the previous audit event that ",[934,1332,1333],{},"caused"," this one. Useful for reconstructing chains of cascading actions.",[434,1336,1337,1338,1340,1341,1344,1345,1347],{},"Most teams set ",[437,1339,1313],{}," to ",[437,1342,1343],{},"requestId",". ",[437,1346,1327],{}," is opt-in and only worth filling when a single user action triggers many internal audit events.",[1349,1350,1351],"style",{},"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 .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}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 .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}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 .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 .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}",{"title":459,"searchDepth":481,"depth":481,"links":1353},[1354,1356,1357,1358,1359,1360],{"id":448,"depth":481,"text":1355},"AuditFields type",{"id":928,"depth":481,"text":929},{"id":1103,"depth":481,"text":1104},{"id":1204,"depth":481,"text":1205},{"id":1266,"depth":481,"text":1267},{"id":1291,"depth":481,"text":1292},"The AuditFields type, action naming conventions, actor types, idempotency, and how the schema sits inside a regular wide event.","md",[1364,1367],{"label":41,"icon":44,"to":134,"color":1365,"variant":1366},"neutral","subtle",{"label":142,"icon":145,"to":143,"color":1365,"variant":1366},{},{"title":137,"icon":140},{"title":429,"description":1361},"gy1kpgQgCJ5-_0ppU0U_2a2vwc_fY_N0gnhdM_FTWZM",[1373,1375],{"title":41,"path":134,"stem":135,"description":1374,"icon":44,"children":-1},"First-class audit logs as a thin layer on top of evlog's wide events. Add tamper-evident audit trails to any app with one enricher, one drain wrapper, and one helper.",{"title":142,"path":143,"stem":144,"description":1376,"icon":145,"children":-1},"log.audit, log.audit.deny, standalone audit(), withAudit auto-instrumentation, defineAuditAction and defineAuditCatalog registries, and auditDiff change patches.",1778349073301]