[{"data":1,"prerenderedAt":992},["ShallowReactive",2],{"navigation_docs":3,"-logging-audit-compliance":427,"-logging-audit-compliance-surround":987},[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":152,"body":429,"description":976,"extension":977,"links":978,"meta":983,"navigation":984,"path":153,"seo":985,"stem":154,"__hash__":986},"docs\u002F2.logging\u002F8.audit\u002F05.compliance.md",{"type":430,"value":431,"toc":969},"minimark",[432,445,450,453,566,589,598,602,609,733,771,775,778,791,804,808,811,870,873,877,965],[433,434,435,436,440,441,444],"p",{},"Compliance frameworks (SOC2, HIPAA, GDPR, PCI) ask the same five questions of every audit log: ",[437,438,439],"strong",{},"who, what, when, from where, with which outcome",", plus ",[437,442,443],{},"how do we know it wasn't tampered with",". evlog answers each one through composition of the existing primitives.",[446,447,449],"h2",{"id":448},"integrity","Integrity",[433,451,452],{},"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.",[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","auditOnly(\n  signed(createFsDrain({ dir: '.audit' }), { strategy: 'hash-chain' }),\n  { await: true },\n)\n","typescript","",[461,462,463,476,542,560],"code",{"__ignoreMap":459},[464,465,468,472],"span",{"class":466,"line":467},"line",1,[464,469,471],{"class":470},"s2Zo4","auditOnly",[464,473,475],{"class":474},"sTEyZ","(\n",[464,477,479,482,485,488,490,494,498,501,504,508,511,514,517,520,523,526,528,530,533,535,537,539],{"class":466,"line":478},2,[464,480,481],{"class":470},"  signed",[464,483,484],{"class":474},"(",[464,486,487],{"class":470},"createFsDrain",[464,489,484],{"class":474},[464,491,493],{"class":492},"sMK4o","{",[464,495,497],{"class":496},"swJcz"," dir",[464,499,500],{"class":492},":",[464,502,503],{"class":492}," '",[464,505,507],{"class":506},"sfazB",".audit",[464,509,510],{"class":492},"'",[464,512,513],{"class":492}," }",[464,515,516],{"class":474},")",[464,518,519],{"class":492},",",[464,521,522],{"class":492}," {",[464,524,525],{"class":496}," strategy",[464,527,500],{"class":492},[464,529,503],{"class":492},[464,531,532],{"class":506},"hash-chain",[464,534,510],{"class":492},[464,536,513],{"class":492},[464,538,516],{"class":474},[464,540,541],{"class":492},",\n",[464,543,545,548,551,553,557],{"class":466,"line":544},3,[464,546,547],{"class":492},"  {",[464,549,550],{"class":496}," await",[464,552,500],{"class":492},[464,554,556],{"class":555},"sfNiH"," true",[464,558,559],{"class":492}," },\n",[464,561,563],{"class":466,"line":562},4,[464,564,565],{"class":474},")\n",[567,568,569,576,577,580,581,584,585,588],"warning",{},[437,570,571,572,575],{},"Rotate ",[461,573,574],{},"secret"," for HMAC-signed audits annually."," When you rotate, embed a key id alongside the signature (e.g. extend ",[461,578,579],{},"AuditFields"," with ",[461,582,583],{},"keyId"," via ",[461,586,587],{},"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.",[433,590,591,592,597],{},"See ",[593,594,596],"a",{"href":595},"\u002Flogging\u002Faudit\u002Fpipeline#signed","Drains & Integrity"," for the difference between HMAC and hash-chain.",[446,599,601],{"id":600},"redact","Redact",[433,603,604,605,608],{},"Audit events run through your existing ",[461,606,607],{},"RedactConfig",". Compose with the strict audit preset to harden PII handling:",[454,610,612],{"className":456,"code":611,"language":458,"meta":459,"style":459},"import { auditRedactPreset } from 'evlog'\n\ninitLogger({\n  redact: {\n    paths: [\n      ...(auditRedactPreset.paths ?? []),\n      'user.password',\n    ],\n  },\n})\n",[461,613,614,638,644,654,664,675,698,711,719,725],{"__ignoreMap":459},[464,615,616,620,622,625,627,630,632,635],{"class":466,"line":467},[464,617,619],{"class":618},"s7zQu","import",[464,621,522],{"class":492},[464,623,624],{"class":474}," auditRedactPreset",[464,626,513],{"class":492},[464,628,629],{"class":618}," from",[464,631,503],{"class":492},[464,633,634],{"class":506},"evlog",[464,636,637],{"class":492},"'\n",[464,639,640],{"class":466,"line":478},[464,641,643],{"emptyLinePlaceholder":642},true,"\n",[464,645,646,649,651],{"class":466,"line":544},[464,647,648],{"class":470},"initLogger",[464,650,484],{"class":474},[464,652,653],{"class":492},"{\n",[464,655,656,659,661],{"class":466,"line":562},[464,657,658],{"class":496},"  redact",[464,660,500],{"class":492},[464,662,663],{"class":492}," {\n",[464,665,667,670,672],{"class":466,"line":666},5,[464,668,669],{"class":496},"    paths",[464,671,500],{"class":492},[464,673,674],{"class":474}," [\n",[464,676,678,681,684,687,690,693,696],{"class":466,"line":677},6,[464,679,680],{"class":492},"      ...",[464,682,683],{"class":474},"(auditRedactPreset",[464,685,686],{"class":492},".",[464,688,689],{"class":474},"paths ",[464,691,692],{"class":492},"??",[464,694,695],{"class":474}," [])",[464,697,541],{"class":492},[464,699,701,704,707,709],{"class":466,"line":700},7,[464,702,703],{"class":492},"      '",[464,705,706],{"class":506},"user.password",[464,708,510],{"class":492},[464,710,541],{"class":492},[464,712,714,717],{"class":466,"line":713},8,[464,715,716],{"class":474},"    ]",[464,718,541],{"class":492},[464,720,722],{"class":466,"line":721},9,[464,723,724],{"class":492},"  },\n",[464,726,728,731],{"class":466,"line":727},10,[464,729,730],{"class":492},"}",[464,732,565],{"class":474},[433,734,735,736,739,740,743,744,747,748,747,751,747,754,747,757,747,760,763,764,767,768,686],{},"The preset drops ",[461,737,738],{},"Authorization"," \u002F ",[461,741,742],{},"Cookie"," headers and common credential field names (",[461,745,746],{},"password",", ",[461,749,750],{},"token",[461,752,753],{},"apiKey",[461,755,756],{},"cardNumber",[461,758,759],{},"cvv",[461,761,762],{},"ssn",") wherever they appear inside ",[461,765,766],{},"audit.changes.before"," and ",[461,769,770],{},"audit.changes.after",[446,772,774],{"id":773},"gdpr-vs-append-only","GDPR vs append-only",[433,776,777],{},"Append-only audit logs collide with GDPR's right to be forgotten. Recommended pattern today:",[779,780,781,785,788],"ol",{},[782,783,784],"li",{},"Keep audit rows immutable.",[782,786,787],{},"Encrypt PII fields with a per-actor key (held outside the audit store).",[782,789,790],{},"To \"forget\" a user, delete their key — the audit row stays, the chain stays valid, the PII becomes unreadable.",[433,792,793,794,797,798,686],{},"A built-in ",[461,795,796],{},"cryptoShredding"," helper is on the ",[593,799,803],{"href":800,"rel":801},"https:\u002F\u002Fgithub.com\u002FHugoRCD\u002Fevlog\u002Fissues",[802],"nofollow","follow-up roadmap",[446,805,807],{"id":806},"retention","Retention",[433,809,810],{},"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:",[812,813,814,827],"table",{},[815,816,817],"thead",{},[818,819,820,824],"tr",{},[821,822,823],"th",{},"Sink",[821,825,826],{},"Retention mechanism",[828,829,830,843,854,862],"tbody",{},[818,831,832,836],{},[833,834,835],"td",{},"FS",[833,837,838,839,842],{},"Combine ",[461,840,841],{},"createFsDrain({ maxFiles })"," with a daily compactor.",[818,844,845,848],{},[833,846,847],{},"Postgres",[833,849,850,851,686],{},"Schedule ",[461,852,853],{},"DELETE FROM audit_events WHERE timestamp \u003C now() - interval '7 years'",[818,855,856,859],{},[833,857,858],{},"Axiom \u002F Datadog \u002F Loki",[833,860,861],{},"Set the dataset retention policy in the platform.",[818,863,864,867],{},[833,865,866],{},"S3 Object Lock",[833,868,869],{},"Configure lifecycle rules + Object Lock retention period.",[433,871,872],{},"Document the chosen window in your security policy. Auditors care about the written rule, not the enforcing component.",[446,874,876],{"id":875},"common-pitfalls","Common Pitfalls",[878,879,880,893,916,922,941,955],"ul",{},[782,881,882,885,886,580,889,892],{},[437,883,884],{},"Logging only successes."," Auditors care most about denials. Always pair ",[461,887,888],{},"log.audit()",[461,890,891],{},"log.audit.deny()"," on the negative branch of every authorisation check.",[782,894,895,901,902,905,906,908,909,747,911,747,913,915],{},[437,896,897,898,686],{},"Leaking PII through ",[461,899,900],{},"changes"," ",[461,903,904],{},"auditDiff()"," runs through your ",[461,907,607],{},", but only if the field paths are listed. Add ",[461,910,746],{},[461,912,750],{},[461,914,753],{},", etc. once globally so you never have to think about it again.",[782,917,918,921],{},[437,919,920],{},"Treating audits as observability."," Don't sample, downsample, or summarise audit events. Force-keep is on by default — don't disable it.",[782,923,924,901,931,933,934,739,937,940],{},[437,925,926,927,930],{},"Conflating ",[461,928,929],{},"actor.id"," with the session id.",[461,932,929],{}," is the stable user id (or system identity). Correlate sessions via ",[461,935,936],{},"context.requestId",[461,938,939],{},"context.traceId",", never via the actor.",[782,942,943,946,947,950,951,954],{},[437,944,945],{},"Forgetting standalone jobs."," Cron tasks, queue workers, and CLIs trigger audit-worthy actions too. Use ",[461,948,949],{},"audit()"," (no request) or ",[461,952,953],{},"withAudit()"," to keep coverage parity with your HTTP routes.",[782,956,957,964],{},[437,958,959,960,963],{},"Skipping ",[461,961,962],{},"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.",[966,967,968],"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":459,"searchDepth":478,"depth":478,"links":970},[971,972,973,974,975],{"id":448,"depth":478,"text":449},{"id":600,"depth":478,"text":601},{"id":773,"depth":478,"text":774},{"id":806,"depth":478,"text":807},{"id":875,"depth":478,"text":876},"Integrity, redact presets, GDPR vs append-only, retention windows, and the most common pitfalls when shipping audit logs to production.","md",[979,982],{"label":596,"icon":150,"to":148,"color":980,"variant":981},"neutral","subtle",{"label":156,"icon":64,"to":157,"color":980,"variant":981},{},{"title":152,"icon":129},{"title":152,"description":976},"IyXFlsbKUUw38ViWHOK2P3nf1U68neZdA_NJqFNoilA",[988,990],{"title":147,"path":148,"stem":149,"description":989,"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":991,"icon":64,"children":-1},"File system, Axiom, and Postgres recipes for audit logs, plus mockAudit for tests and the full API reference.",1778346899266]