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