[{"data":1,"prerenderedAt":986},["ShallowReactive",2],{"navigation_docs":3,"-logging-audit-compliance":421,"-logging-audit-compliance-surround":981},[4,35,159,201,289,318,405],{"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,299,304,309,314],{"title":295,"path":296,"stem":297,"icon":298},"Identity headers","\u002Fbuild-on-top\u002Fidentity-headers","5.build-on-top\u002F1.identity-headers","i-lucide-fingerprint",{"title":300,"path":301,"stem":302,"icon":303},"Stream API","\u002Fbuild-on-top\u002Fstream-api","5.build-on-top\u002F2.stream-api","i-lucide-radio-tower",{"title":305,"path":306,"stem":307,"icon":308},"SSE bridge","\u002Fbuild-on-top\u002Fsse-bridge","5.build-on-top\u002F3.sse-bridge","i-lucide-wifi",{"title":310,"path":311,"stem":312,"icon":313},"FS reader","\u002Fbuild-on-top\u002Ffs-reader","5.build-on-top\u002F4.fs-reader","i-lucide-folder-search",{"title":156,"path":315,"stem":316,"icon":317},"\u002Fbuild-on-top\u002Frecipes","5.build-on-top\u002F4.recipes","i-lucide-chef-hat",{"title":319,"path":320,"stem":321,"children":322,"page":34},"Adapters","\u002Fadapters","6.adapters",[323,326,366,381],{"title":41,"path":324,"stem":325,"icon":44},"\u002Fadapters\u002Foverview","6.adapters\u002F01.overview",{"title":327,"path":328,"stem":329,"children":330,"page":34},"Cloud destinations","\u002Fadapters\u002Fcloud","6.adapters\u002F02.cloud",[331,336,341,346,351,356,361],{"title":332,"path":333,"stem":334,"icon":335},"Axiom","\u002Fadapters\u002Fcloud\u002Faxiom","6.adapters\u002F02.cloud\u002F01.axiom","i-custom-axiom",{"title":337,"path":338,"stem":339,"icon":340},"OTLP","\u002Fadapters\u002Fcloud\u002Fotlp","6.adapters\u002F02.cloud\u002F02.otlp","i-simple-icons-opentelemetry",{"title":342,"path":343,"stem":344,"icon":345},"PostHog","\u002Fadapters\u002Fcloud\u002Fposthog","6.adapters\u002F02.cloud\u002F03.posthog","i-simple-icons-posthog",{"title":347,"path":348,"stem":349,"icon":350},"Sentry","\u002Fadapters\u002Fcloud\u002Fsentry","6.adapters\u002F02.cloud\u002F04.sentry","i-simple-icons-sentry",{"title":352,"path":353,"stem":354,"icon":355},"Better Stack","\u002Fadapters\u002Fcloud\u002Fbetter-stack","6.adapters\u002F02.cloud\u002F05.better-stack","i-simple-icons-betterstack",{"title":357,"path":358,"stem":359,"icon":360},"Datadog","\u002Fadapters\u002Fcloud\u002Fdatadog","6.adapters\u002F02.cloud\u002F06.datadog","i-simple-icons-datadog",{"title":362,"path":363,"stem":364,"icon":365},"HyperDX","\u002Fadapters\u002Fcloud\u002Fhyperdx","6.adapters\u002F02.cloud\u002F07.hyperdx","i-custom-hyperdx",{"title":367,"path":368,"stem":369,"children":370,"page":34},"Self-hosted","\u002Fadapters\u002Fself-hosted","6.adapters\u002F03.self-hosted",[371,376],{"title":372,"path":373,"stem":374,"icon":375},"File System","\u002Fadapters\u002Fself-hosted\u002Ffs","6.adapters\u002F03.self-hosted\u002F01.fs","i-lucide-hard-drive",{"title":377,"path":378,"stem":379,"icon":380},"NuxtHub","\u002Fadapters\u002Fself-hosted\u002Fnuxthub","6.adapters\u002F03.self-hosted\u002F02.nuxthub","i-simple-icons-nuxt",{"title":382,"path":383,"stem":384,"children":385,"page":34},"Building blocks","\u002Fadapters\u002Fbuilding-blocks","6.adapters\u002F04.building-blocks",[386,391,396,400],{"title":387,"path":388,"stem":389,"icon":390},"Pipeline","\u002Fadapters\u002Fbuilding-blocks\u002Fpipeline","6.adapters\u002F04.building-blocks\u002F01.pipeline","i-lucide-workflow",{"title":392,"path":393,"stem":394,"icon":395},"HTTP","\u002Fadapters\u002Fbuilding-blocks\u002Fhttp","6.adapters\u002F04.building-blocks\u002F02.http","i-lucide-globe",{"title":397,"path":398,"stem":399,"icon":83},"Custom Adapters","\u002Fadapters\u002Fbuilding-blocks\u002Fcustom","6.adapters\u002F04.building-blocks\u002F03.custom",{"title":401,"path":402,"stem":403,"icon":404},"Toolkit","\u002Fadapters\u002Fbuilding-blocks\u002Ftoolkit","6.adapters\u002F04.building-blocks\u002F04.toolkit","i-lucide-blocks",{"title":406,"path":407,"stem":408,"children":409,"page":34},"Enrichers","\u002Fenrichers","7.enrichers",[410,413,417],{"title":41,"path":411,"stem":412,"icon":28},"\u002Fenrichers\u002Foverview","7.enrichers\u002F1.overview",{"title":414,"path":415,"stem":416,"icon":288},"Built-in","\u002Fenrichers\u002Fbuilt-in","7.enrichers\u002F2.built-in",{"title":418,"path":419,"stem":420,"icon":83},"Custom","\u002Fenrichers\u002Fcustom","7.enrichers\u002F3.custom",{"id":422,"title":152,"body":423,"description":970,"extension":971,"links":972,"meta":977,"navigation":978,"path":153,"seo":979,"stem":154,"__hash__":980},"docs\u002F2.logging\u002F8.audit\u002F05.compliance.md",{"type":424,"value":425,"toc":963},"minimark",[426,439,444,447,560,583,592,596,603,727,765,769,772,785,798,802,805,864,867,871,959],[427,428,429,430,434,435,438],"p",{},"Compliance frameworks (SOC2, HIPAA, GDPR, PCI) ask the same five questions of every audit log: ",[431,432,433],"strong",{},"who, what, when, from where, with which outcome",", plus ",[431,436,437],{},"how do we know it wasn't tampered with",". evlog answers each one through composition of the existing primitives.",[440,441,443],"h2",{"id":442},"integrity","Integrity",[427,445,446],{},"Hash-chain the audit log so any tampering is detectable. Each event's hash includes the previous hash, so deleting a row breaks the chain forward of that point.",[448,449,454],"pre",{"className":450,"code":451,"language":452,"meta":453,"style":453},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","auditOnly(\n  signed(createFsDrain({ dir: '.audit' }), { strategy: 'hash-chain' }),\n  { await: true },\n)\n","typescript","",[455,456,457,470,536,554],"code",{"__ignoreMap":453},[458,459,462,466],"span",{"class":460,"line":461},"line",1,[458,463,465],{"class":464},"s2Zo4","auditOnly",[458,467,469],{"class":468},"sTEyZ","(\n",[458,471,473,476,479,482,484,488,492,495,498,502,505,508,511,514,517,520,522,524,527,529,531,533],{"class":460,"line":472},2,[458,474,475],{"class":464},"  signed",[458,477,478],{"class":468},"(",[458,480,481],{"class":464},"createFsDrain",[458,483,478],{"class":468},[458,485,487],{"class":486},"sMK4o","{",[458,489,491],{"class":490},"swJcz"," dir",[458,493,494],{"class":486},":",[458,496,497],{"class":486}," '",[458,499,501],{"class":500},"sfazB",".audit",[458,503,504],{"class":486},"'",[458,506,507],{"class":486}," }",[458,509,510],{"class":468},")",[458,512,513],{"class":486},",",[458,515,516],{"class":486}," {",[458,518,519],{"class":490}," strategy",[458,521,494],{"class":486},[458,523,497],{"class":486},[458,525,526],{"class":500},"hash-chain",[458,528,504],{"class":486},[458,530,507],{"class":486},[458,532,510],{"class":468},[458,534,535],{"class":486},",\n",[458,537,539,542,545,547,551],{"class":460,"line":538},3,[458,540,541],{"class":486},"  {",[458,543,544],{"class":490}," await",[458,546,494],{"class":486},[458,548,550],{"class":549},"sfNiH"," true",[458,552,553],{"class":486}," },\n",[458,555,557],{"class":460,"line":556},4,[458,558,559],{"class":468},")\n",[561,562,563,570,571,574,575,578,579,582],"warning",{},[431,564,565,566,569],{},"Rotate ",[455,567,568],{},"secret"," for HMAC-signed audits annually."," When you rotate, embed a key id alongside the signature (e.g. extend ",[455,572,573],{},"AuditFields"," with ",[455,576,577],{},"keyId"," via ",[455,580,581],{},"declare module",") so old events stay verifiable against the previous secret. Verifiers should look up the key by id, not assume a single global secret.",[427,584,585,586,591],{},"See ",[587,588,590],"a",{"href":589},"\u002Flogging\u002Faudit\u002Fpipeline#signed","Drains & Integrity"," for the difference between HMAC and hash-chain.",[440,593,595],{"id":594},"redact","Redact",[427,597,598,599,602],{},"Audit events run through your existing ",[455,600,601],{},"RedactConfig",". Compose with the strict audit preset to harden PII handling:",[448,604,606],{"className":450,"code":605,"language":452,"meta":453,"style":453},"import { auditRedactPreset } from 'evlog'\n\ninitLogger({\n  redact: {\n    paths: [\n      ...(auditRedactPreset.paths ?? []),\n      'user.password',\n    ],\n  },\n})\n",[455,607,608,632,638,648,658,669,692,705,713,719],{"__ignoreMap":453},[458,609,610,614,616,619,621,624,626,629],{"class":460,"line":461},[458,611,613],{"class":612},"s7zQu","import",[458,615,516],{"class":486},[458,617,618],{"class":468}," auditRedactPreset",[458,620,507],{"class":486},[458,622,623],{"class":612}," from",[458,625,497],{"class":486},[458,627,628],{"class":500},"evlog",[458,630,631],{"class":486},"'\n",[458,633,634],{"class":460,"line":472},[458,635,637],{"emptyLinePlaceholder":636},true,"\n",[458,639,640,643,645],{"class":460,"line":538},[458,641,642],{"class":464},"initLogger",[458,644,478],{"class":468},[458,646,647],{"class":486},"{\n",[458,649,650,653,655],{"class":460,"line":556},[458,651,652],{"class":490},"  redact",[458,654,494],{"class":486},[458,656,657],{"class":486}," {\n",[458,659,661,664,666],{"class":460,"line":660},5,[458,662,663],{"class":490},"    paths",[458,665,494],{"class":486},[458,667,668],{"class":468}," [\n",[458,670,672,675,678,681,684,687,690],{"class":460,"line":671},6,[458,673,674],{"class":486},"      ...",[458,676,677],{"class":468},"(auditRedactPreset",[458,679,680],{"class":486},".",[458,682,683],{"class":468},"paths ",[458,685,686],{"class":486},"??",[458,688,689],{"class":468}," [])",[458,691,535],{"class":486},[458,693,695,698,701,703],{"class":460,"line":694},7,[458,696,697],{"class":486},"      '",[458,699,700],{"class":500},"user.password",[458,702,504],{"class":486},[458,704,535],{"class":486},[458,706,708,711],{"class":460,"line":707},8,[458,709,710],{"class":468},"    ]",[458,712,535],{"class":486},[458,714,716],{"class":460,"line":715},9,[458,717,718],{"class":486},"  },\n",[458,720,722,725],{"class":460,"line":721},10,[458,723,724],{"class":486},"}",[458,726,559],{"class":468},[427,728,729,730,733,734,737,738,741,742,741,745,741,748,741,751,741,754,757,758,761,762,680],{},"The preset drops ",[455,731,732],{},"Authorization"," \u002F ",[455,735,736],{},"Cookie"," headers and common credential field names (",[455,739,740],{},"password",", ",[455,743,744],{},"token",[455,746,747],{},"apiKey",[455,749,750],{},"cardNumber",[455,752,753],{},"cvv",[455,755,756],{},"ssn",") wherever they appear inside ",[455,759,760],{},"audit.changes.before"," and ",[455,763,764],{},"audit.changes.after",[440,766,768],{"id":767},"gdpr-vs-append-only","GDPR vs append-only",[427,770,771],{},"Append-only audit logs collide with GDPR's right to be forgotten. Recommended pattern today:",[773,774,775,779,782],"ol",{},[776,777,778],"li",{},"Keep audit rows immutable.",[776,780,781],{},"Encrypt PII fields with a per-actor key (held outside the audit store).",[776,783,784],{},"To \"forget\" a user, delete their key — the audit row stays, the chain stays valid, the PII becomes unreadable.",[427,786,787,788,791,792,680],{},"A built-in ",[455,789,790],{},"cryptoShredding"," helper is on the ",[587,793,797],{"href":794,"rel":795},"https:\u002F\u002Fgithub.com\u002FHugoRCD\u002Fevlog\u002Fissues",[796],"nofollow","follow-up roadmap",[440,799,801],{"id":800},"retention","Retention",[427,803,804],{},"Retention is a storage-layer concern by design. evlog's audit layer doesn't enforce retention windows because every supported sink already has a stronger, audited mechanism for it. Pick the one matching your sink:",[806,807,808,821],"table",{},[809,810,811],"thead",{},[812,813,814,818],"tr",{},[815,816,817],"th",{},"Sink",[815,819,820],{},"Retention mechanism",[822,823,824,837,848,856],"tbody",{},[812,825,826,830],{},[827,828,829],"td",{},"FS",[827,831,832,833,836],{},"Combine ",[455,834,835],{},"createFsDrain({ maxFiles })"," with a daily compactor.",[812,838,839,842],{},[827,840,841],{},"Postgres",[827,843,844,845,680],{},"Schedule ",[455,846,847],{},"DELETE FROM audit_events WHERE timestamp \u003C now() - interval '7 years'",[812,849,850,853],{},[827,851,852],{},"Axiom \u002F Datadog \u002F Loki",[827,854,855],{},"Set the dataset retention policy in the platform.",[812,857,858,861],{},[827,859,860],{},"S3 Object Lock",[827,862,863],{},"Configure lifecycle rules + Object Lock retention period.",[427,865,866],{},"Document the chosen window in your security policy. Auditors care about the written rule, not the enforcing component.",[440,868,870],{"id":869},"common-pitfalls","Common Pitfalls",[872,873,874,887,910,916,935,949],"ul",{},[776,875,876,879,880,574,883,886],{},[431,877,878],{},"Logging only successes."," Auditors care most about denials. Always pair ",[455,881,882],{},"log.audit()",[455,884,885],{},"log.audit.deny()"," on the negative branch of every authorisation check.",[776,888,889,895,896,899,900,902,903,741,905,741,907,909],{},[431,890,891,892,680],{},"Leaking PII through ",[455,893,894],{},"changes"," ",[455,897,898],{},"auditDiff()"," runs through your ",[455,901,601],{},", but only if the field paths are listed. Add ",[455,904,740],{},[455,906,744],{},[455,908,747],{},", etc. once globally so you never have to think about it again.",[776,911,912,915],{},[431,913,914],{},"Treating audits as observability."," Don't sample, downsample, or summarise audit events. Force-keep is on by default — don't disable it.",[776,917,918,895,925,927,928,733,931,934],{},[431,919,920,921,924],{},"Conflating ",[455,922,923],{},"actor.id"," with the session id.",[455,926,923],{}," is the stable user id (or system identity). Correlate sessions via ",[455,929,930],{},"context.requestId",[455,932,933],{},"context.traceId",", never via the actor.",[776,936,937,940,941,944,945,948],{},[431,938,939],{},"Forgetting standalone jobs."," Cron tasks, queue workers, and CLIs trigger audit-worthy actions too. Use ",[455,942,943],{},"audit()"," (no request) or ",[455,946,947],{},"withAudit()"," to keep coverage parity with your HTTP routes.",[776,950,951,958],{},[431,952,953,954,957],{},"Skipping ",[455,955,956],{},"await: true"," on the audit drain."," Without it, audits are fire-and-forget — a crash between the event being emitted and the drain flushing means the action happened but no audit row exists.",[960,961,962],"style",{},"html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}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 .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}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":453,"searchDepth":472,"depth":472,"links":964},[965,966,967,968,969],{"id":442,"depth":472,"text":443},{"id":594,"depth":472,"text":595},{"id":767,"depth":472,"text":768},{"id":800,"depth":472,"text":801},{"id":869,"depth":472,"text":870},"Integrity, redact presets, GDPR vs append-only, retention windows, and the most common pitfalls when shipping audit logs to production.","md",[973,976],{"label":590,"icon":150,"to":148,"color":974,"variant":975},"neutral","subtle",{"label":156,"icon":64,"to":157,"color":974,"variant":975},{},{"title":152,"icon":129},{"title":152,"description":970},"IyXFlsbKUUw38ViWHOK2P3nf1U68neZdA_NJqFNoilA",[982,984],{"title":147,"path":148,"stem":149,"description":983,"icon":150,"children":-1},"auditEnricher to auto-fill request context, auditOnly to route audits to a dedicated sink, and signed for tamper-evident HMAC or hash-chain integrity.",{"title":156,"path":157,"stem":158,"description":985,"icon":64,"children":-1},"File system, Axiom, and Postgres recipes for audit logs, plus mockAudit for tests and the full API reference.",1778330170934]