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