[{"data":1,"prerenderedAt":953},["ShallowReactive",2],{"navigation_docs":3,"-logging-audit-compliance":388,"-logging-audit-compliance-surround":948},[4,35,155,197,285,372],{"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,94,122],{"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},"Client Logging","\u002Flogging\u002Fclient-logging","2.logging\u002F4.client-logging","i-lucide-monitor",{"title":66,"icon":67,"path":68,"stem":69,"children":70,"page":34},"AI SDK","i-simple-icons-vercel","\u002Flogging\u002Fai-sdk","2.logging\u002F5.ai-sdk",[71,74,79,84,89],{"title":41,"path":72,"stem":73,"icon":44},"\u002Flogging\u002Fai-sdk\u002Foverview","2.logging\u002F5.ai-sdk\u002F01.overview",{"title":75,"path":76,"stem":77,"icon":78},"Usage","\u002Flogging\u002Fai-sdk\u002Fusage","2.logging\u002F5.ai-sdk\u002F02.usage","i-lucide-code",{"title":80,"path":81,"stem":82,"icon":83},"Options","\u002Flogging\u002Fai-sdk\u002Foptions","2.logging\u002F5.ai-sdk\u002F03.options","i-lucide-sliders",{"title":85,"path":86,"stem":87,"icon":88},"Metadata","\u002Flogging\u002Fai-sdk\u002Fmetadata","2.logging\u002F5.ai-sdk\u002F04.metadata","i-lucide-database",{"title":90,"path":91,"stem":92,"icon":93},"Telemetry","\u002Flogging\u002Fai-sdk\u002Ftelemetry","2.logging\u002F5.ai-sdk\u002F05.telemetry","i-lucide-activity",{"title":95,"icon":96,"path":97,"stem":98,"children":99,"page":34},"Better Auth","i-simple-icons-betterauth","\u002Flogging\u002Fbetter-auth","2.logging\u002F6.better-auth",[100,103,108,113,117],{"title":41,"path":101,"stem":102,"icon":44},"\u002Flogging\u002Fbetter-auth\u002Foverview","2.logging\u002F6.better-auth\u002F01.overview",{"title":104,"path":105,"stem":106,"icon":107},"Identify User","\u002Flogging\u002Fbetter-auth\u002Fidentify-user","2.logging\u002F6.better-auth\u002F02.identify-user","i-lucide-user-check",{"title":109,"path":110,"stem":111,"icon":112},"Middleware","\u002Flogging\u002Fbetter-auth\u002Fmiddleware","2.logging\u002F6.better-auth\u002F03.middleware","i-lucide-shield",{"title":114,"path":115,"stem":116,"icon":64},"Client Sync","\u002Flogging\u002Fbetter-auth\u002Fclient-sync","2.logging\u002F6.better-auth\u002F04.client-sync",{"title":118,"path":119,"stem":120,"icon":121},"Performance","\u002Flogging\u002Fbetter-auth\u002Fperformance","2.logging\u002F6.better-auth\u002F05.performance","i-lucide-gauge",{"title":123,"icon":124,"path":125,"stem":126,"children":127,"page":34},"Audit Logs","i-lucide-shield-check","\u002Flogging\u002Faudit","2.logging\u002F7.audit",[128,131,136,141,146,150],{"title":41,"path":129,"stem":130,"icon":44},"\u002Flogging\u002Faudit\u002Foverview","2.logging\u002F7.audit\u002F01.overview",{"title":132,"path":133,"stem":134,"icon":135},"Schema","\u002Flogging\u002Faudit\u002Fschema","2.logging\u002F7.audit\u002F02.schema","i-lucide-file-text",{"title":137,"path":138,"stem":139,"icon":140},"Recording","\u002Flogging\u002Faudit\u002Frecording","2.logging\u002F7.audit\u002F03.recording","i-lucide-pen-line",{"title":142,"path":143,"stem":144,"icon":145},"Drains","\u002Flogging\u002Faudit\u002Fpipeline","2.logging\u002F7.audit\u002F04.pipeline","i-lucide-link",{"title":147,"path":148,"stem":149,"icon":124},"Compliance","\u002Flogging\u002Faudit\u002Fcompliance","2.logging\u002F7.audit\u002F05.compliance",{"title":151,"path":152,"stem":153,"icon":154},"Recipes","\u002Flogging\u002Faudit\u002Frecipes","2.logging\u002F7.audit\u002F06.recipes","i-lucide-book-open",{"title":156,"path":157,"stem":158,"children":159,"page":34},"Core Concepts","\u002Fcore-concepts","3.core-concepts",[160,165,170,175,180,184,187,192],{"title":161,"path":162,"stem":163,"icon":164},"Lifecycle","\u002Fcore-concepts\u002Flifecycle","3.core-concepts\u002F0.lifecycle","i-lucide-arrow-right-left",{"title":166,"path":167,"stem":168,"icon":169},"Configuration","\u002Fcore-concepts\u002Fconfiguration","3.core-concepts\u002F1.configuration","i-lucide-settings",{"title":171,"path":172,"stem":173,"icon":174},"Sampling","\u002Fcore-concepts\u002Fsampling","3.core-concepts\u002F2.sampling","i-lucide-filter",{"title":176,"path":177,"stem":178,"icon":179},"Typed Fields","\u002Fcore-concepts\u002Ftyped-fields","3.core-concepts\u002F3.typed-fields","i-simple-icons-typescript",{"title":181,"path":182,"stem":183,"icon":124},"Best Practices","\u002Fcore-concepts\u002Fbest-practices","3.core-concepts\u002F4.best-practices",{"title":118,"path":185,"stem":186,"icon":121},"\u002Fcore-concepts\u002Fperformance","3.core-concepts\u002F5.performance",{"title":188,"path":189,"stem":190,"icon":191},"Vite Plugin","\u002Fcore-concepts\u002Fvite-plugin","3.core-concepts\u002F6.vite-plugin","i-custom-vite",{"title":193,"path":194,"stem":195,"icon":196},"Auto-Redaction","\u002Fcore-concepts\u002Fredaction","3.core-concepts\u002F7.redaction","i-lucide-eye-off",{"title":198,"path":199,"stem":200,"children":201,"page":34},"Frameworks","\u002Fframeworks","4.frameworks",[202,206,211,216,221,226,231,236,241,246,251,256,261,266,270,275,280],{"title":41,"path":203,"stem":204,"icon":205},"\u002Fframeworks\u002Foverview","4.frameworks\u002F00.overview","i-lucide-layout-grid",{"title":207,"path":208,"stem":209,"icon":210},"Nuxt","\u002Fframeworks\u002Fnuxt","4.frameworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":212,"path":213,"stem":214,"icon":215},"Next.js","\u002Fframeworks\u002Fnextjs","4.frameworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":217,"path":218,"stem":219,"icon":220},"SvelteKit","\u002Fframeworks\u002Fsveltekit","4.frameworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":222,"path":223,"stem":224,"icon":225},"Nitro","\u002Fframeworks\u002Fnitro","4.frameworks\u002F04.nitro","i-custom-nitro",{"title":227,"path":228,"stem":229,"icon":230},"TanStack Start","\u002Fframeworks\u002Ftanstack-start","4.frameworks\u002F05.tanstack-start","i-custom-tanstack",{"title":232,"path":233,"stem":234,"icon":235},"NestJS","\u002Fframeworks\u002Fnestjs","4.frameworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":237,"path":238,"stem":239,"icon":240},"Express","\u002Fframeworks\u002Fexpress","4.frameworks\u002F07.express","i-simple-icons-express",{"title":242,"path":243,"stem":244,"icon":245},"Hono","\u002Fframeworks\u002Fhono","4.frameworks\u002F08.hono","i-simple-icons-hono",{"title":247,"path":248,"stem":249,"icon":250},"Fastify","\u002Fframeworks\u002Ffastify","4.frameworks\u002F09.fastify","i-simple-icons-fastify",{"title":252,"path":253,"stem":254,"icon":255},"Elysia","\u002Fframeworks\u002Felysia","4.frameworks\u002F10.elysia","i-custom-elysia",{"title":257,"path":258,"stem":259,"icon":260},"React Router","\u002Fframeworks\u002Freact-router","4.frameworks\u002F11.react-router","i-custom-reactrouter",{"title":262,"path":263,"stem":264,"icon":265},"Cloudflare Workers","\u002Fframeworks\u002Fcloudflare-workers","4.frameworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":267,"path":268,"stem":269,"icon":179},"Standalone","\u002Fframeworks\u002Fstandalone","4.frameworks\u002F13.standalone",{"title":271,"path":272,"stem":273,"icon":274},"Astro","\u002Fframeworks\u002Fastro","4.frameworks\u002F14.astro","i-simple-icons-astro",{"title":276,"path":277,"stem":278,"icon":279},"AWS Lambda","\u002Fframeworks\u002Faws-lambda","4.frameworks\u002F16.aws-lambda","i-custom-lambda",{"title":281,"path":282,"stem":283,"icon":284},"Custom Integration","\u002Fframeworks\u002Fcustom-integration","4.frameworks\u002F17.custom-integration","i-lucide-puzzle",{"title":286,"path":287,"stem":288,"children":289,"page":34},"Adapters","\u002Fadapters","6.adapters",[290,293,333,348],{"title":41,"path":291,"stem":292,"icon":44},"\u002Fadapters\u002Foverview","6.adapters\u002F01.overview",{"title":294,"path":295,"stem":296,"children":297,"page":34},"Cloud destinations","\u002Fadapters\u002Fcloud","6.adapters\u002F02.cloud",[298,303,308,313,318,323,328],{"title":299,"path":300,"stem":301,"icon":302},"Axiom","\u002Fadapters\u002Fcloud\u002Faxiom","6.adapters\u002F02.cloud\u002F01.axiom","i-custom-axiom",{"title":304,"path":305,"stem":306,"icon":307},"OTLP","\u002Fadapters\u002Fcloud\u002Fotlp","6.adapters\u002F02.cloud\u002F02.otlp","i-simple-icons-opentelemetry",{"title":309,"path":310,"stem":311,"icon":312},"PostHog","\u002Fadapters\u002Fcloud\u002Fposthog","6.adapters\u002F02.cloud\u002F03.posthog","i-simple-icons-posthog",{"title":314,"path":315,"stem":316,"icon":317},"Sentry","\u002Fadapters\u002Fcloud\u002Fsentry","6.adapters\u002F02.cloud\u002F04.sentry","i-simple-icons-sentry",{"title":319,"path":320,"stem":321,"icon":322},"Better Stack","\u002Fadapters\u002Fcloud\u002Fbetter-stack","6.adapters\u002F02.cloud\u002F05.better-stack","i-simple-icons-betterstack",{"title":324,"path":325,"stem":326,"icon":327},"Datadog","\u002Fadapters\u002Fcloud\u002Fdatadog","6.adapters\u002F02.cloud\u002F06.datadog","i-simple-icons-datadog",{"title":329,"path":330,"stem":331,"icon":332},"HyperDX","\u002Fadapters\u002Fcloud\u002Fhyperdx","6.adapters\u002F02.cloud\u002F07.hyperdx","i-custom-hyperdx",{"title":334,"path":335,"stem":336,"children":337,"page":34},"Self-hosted","\u002Fadapters\u002Fself-hosted","6.adapters\u002F03.self-hosted",[338,343],{"title":339,"path":340,"stem":341,"icon":342},"File System","\u002Fadapters\u002Fself-hosted\u002Ffs","6.adapters\u002F03.self-hosted\u002F01.fs","i-lucide-hard-drive",{"title":344,"path":345,"stem":346,"icon":347},"NuxtHub","\u002Fadapters\u002Fself-hosted\u002Fnuxthub","6.adapters\u002F03.self-hosted\u002F02.nuxthub","i-simple-icons-nuxt",{"title":349,"path":350,"stem":351,"children":352,"page":34},"Building blocks","\u002Fadapters\u002Fbuilding-blocks","6.adapters\u002F04.building-blocks",[353,358,363,367],{"title":354,"path":355,"stem":356,"icon":357},"Pipeline","\u002Fadapters\u002Fbuilding-blocks\u002Fpipeline","6.adapters\u002F04.building-blocks\u002F01.pipeline","i-lucide-workflow",{"title":359,"path":360,"stem":361,"icon":362},"HTTP","\u002Fadapters\u002Fbuilding-blocks\u002Fhttp","6.adapters\u002F04.building-blocks\u002F02.http","i-lucide-globe",{"title":364,"path":365,"stem":366,"icon":78},"Custom Adapters","\u002Fadapters\u002Fbuilding-blocks\u002Fcustom","6.adapters\u002F04.building-blocks\u002F03.custom",{"title":368,"path":369,"stem":370,"icon":371},"Toolkit","\u002Fadapters\u002Fbuilding-blocks\u002Ftoolkit","6.adapters\u002F04.building-blocks\u002F04.toolkit","i-lucide-blocks",{"title":373,"path":374,"stem":375,"children":376,"page":34},"Enrichers","\u002Fenrichers","7.enrichers",[377,380,384],{"title":41,"path":378,"stem":379,"icon":28},"\u002Fenrichers\u002Foverview","7.enrichers\u002F1.overview",{"title":381,"path":382,"stem":383,"icon":284},"Built-in","\u002Fenrichers\u002Fbuilt-in","7.enrichers\u002F2.built-in",{"title":385,"path":386,"stem":387,"icon":78},"Custom","\u002Fenrichers\u002Fcustom","7.enrichers\u002F3.custom",{"id":389,"title":147,"body":390,"description":937,"extension":938,"links":939,"meta":944,"navigation":945,"path":148,"seo":946,"stem":149,"__hash__":947},"docs\u002F2.logging\u002F7.audit\u002F05.compliance.md",{"type":391,"value":392,"toc":930},"minimark",[393,406,411,414,527,550,559,563,570,694,732,736,739,752,765,769,772,831,834,838,926],[394,395,396,397,401,402,405],"p",{},"Compliance frameworks (SOC2, HIPAA, GDPR, PCI) ask the same five questions of every audit log: ",[398,399,400],"strong",{},"who, what, when, from where, with which outcome",", plus ",[398,403,404],{},"how do we know it wasn't tampered with",". evlog answers each one through composition of the existing primitives.",[407,408,410],"h2",{"id":409},"integrity","Integrity",[394,412,413],{},"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.",[415,416,421],"pre",{"className":417,"code":418,"language":419,"meta":420,"style":420},"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","",[422,423,424,437,503,521],"code",{"__ignoreMap":420},[425,426,429,433],"span",{"class":427,"line":428},"line",1,[425,430,432],{"class":431},"s2Zo4","auditOnly",[425,434,436],{"class":435},"sTEyZ","(\n",[425,438,440,443,446,449,451,455,459,462,465,469,472,475,478,481,484,487,489,491,494,496,498,500],{"class":427,"line":439},2,[425,441,442],{"class":431},"  signed",[425,444,445],{"class":435},"(",[425,447,448],{"class":431},"createFsDrain",[425,450,445],{"class":435},[425,452,454],{"class":453},"sMK4o","{",[425,456,458],{"class":457},"swJcz"," dir",[425,460,461],{"class":453},":",[425,463,464],{"class":453}," '",[425,466,468],{"class":467},"sfazB",".audit",[425,470,471],{"class":453},"'",[425,473,474],{"class":453}," }",[425,476,477],{"class":435},")",[425,479,480],{"class":453},",",[425,482,483],{"class":453}," {",[425,485,486],{"class":457}," strategy",[425,488,461],{"class":453},[425,490,464],{"class":453},[425,492,493],{"class":467},"hash-chain",[425,495,471],{"class":453},[425,497,474],{"class":453},[425,499,477],{"class":435},[425,501,502],{"class":453},",\n",[425,504,506,509,512,514,518],{"class":427,"line":505},3,[425,507,508],{"class":453},"  {",[425,510,511],{"class":457}," await",[425,513,461],{"class":453},[425,515,517],{"class":516},"sfNiH"," true",[425,519,520],{"class":453}," },\n",[425,522,524],{"class":427,"line":523},4,[425,525,526],{"class":435},")\n",[528,529,530,537,538,541,542,545,546,549],"warning",{},[398,531,532,533,536],{},"Rotate ",[422,534,535],{},"secret"," for HMAC-signed audits annually."," When you rotate, embed a key id alongside the signature (e.g. extend ",[422,539,540],{},"AuditFields"," with ",[422,543,544],{},"keyId"," via ",[422,547,548],{},"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.",[394,551,552,553,558],{},"See ",[554,555,557],"a",{"href":556},"\u002Flogging\u002Faudit\u002Fpipeline#signed","Drains & Integrity"," for the difference between HMAC and hash-chain.",[407,560,562],{"id":561},"redact","Redact",[394,564,565,566,569],{},"Audit events run through your existing ",[422,567,568],{},"RedactConfig",". Compose with the strict audit preset to harden PII handling:",[415,571,573],{"className":417,"code":572,"language":419,"meta":420,"style":420},"import { auditRedactPreset } from 'evlog'\n\ninitLogger({\n  redact: {\n    paths: [\n      ...(auditRedactPreset.paths ?? []),\n      'user.password',\n    ],\n  },\n})\n",[422,574,575,599,605,615,625,636,659,672,680,686],{"__ignoreMap":420},[425,576,577,581,583,586,588,591,593,596],{"class":427,"line":428},[425,578,580],{"class":579},"s7zQu","import",[425,582,483],{"class":453},[425,584,585],{"class":435}," auditRedactPreset",[425,587,474],{"class":453},[425,589,590],{"class":579}," from",[425,592,464],{"class":453},[425,594,595],{"class":467},"evlog",[425,597,598],{"class":453},"'\n",[425,600,601],{"class":427,"line":439},[425,602,604],{"emptyLinePlaceholder":603},true,"\n",[425,606,607,610,612],{"class":427,"line":505},[425,608,609],{"class":431},"initLogger",[425,611,445],{"class":435},[425,613,614],{"class":453},"{\n",[425,616,617,620,622],{"class":427,"line":523},[425,618,619],{"class":457},"  redact",[425,621,461],{"class":453},[425,623,624],{"class":453}," {\n",[425,626,628,631,633],{"class":427,"line":627},5,[425,629,630],{"class":457},"    paths",[425,632,461],{"class":453},[425,634,635],{"class":435}," [\n",[425,637,639,642,645,648,651,654,657],{"class":427,"line":638},6,[425,640,641],{"class":453},"      ...",[425,643,644],{"class":435},"(auditRedactPreset",[425,646,647],{"class":453},".",[425,649,650],{"class":435},"paths ",[425,652,653],{"class":453},"??",[425,655,656],{"class":435}," [])",[425,658,502],{"class":453},[425,660,662,665,668,670],{"class":427,"line":661},7,[425,663,664],{"class":453},"      '",[425,666,667],{"class":467},"user.password",[425,669,471],{"class":453},[425,671,502],{"class":453},[425,673,675,678],{"class":427,"line":674},8,[425,676,677],{"class":435},"    ]",[425,679,502],{"class":453},[425,681,683],{"class":427,"line":682},9,[425,684,685],{"class":453},"  },\n",[425,687,689,692],{"class":427,"line":688},10,[425,690,691],{"class":453},"}",[425,693,526],{"class":435},[394,695,696,697,700,701,704,705,708,709,708,712,708,715,708,718,708,721,724,725,728,729,647],{},"The preset drops ",[422,698,699],{},"Authorization"," \u002F ",[422,702,703],{},"Cookie"," headers and common credential field names (",[422,706,707],{},"password",", ",[422,710,711],{},"token",[422,713,714],{},"apiKey",[422,716,717],{},"cardNumber",[422,719,720],{},"cvv",[422,722,723],{},"ssn",") wherever they appear inside ",[422,726,727],{},"audit.changes.before"," and ",[422,730,731],{},"audit.changes.after",[407,733,735],{"id":734},"gdpr-vs-append-only","GDPR vs append-only",[394,737,738],{},"Append-only audit logs collide with GDPR's right to be forgotten. Recommended pattern today:",[740,741,742,746,749],"ol",{},[743,744,745],"li",{},"Keep audit rows immutable.",[743,747,748],{},"Encrypt PII fields with a per-actor key (held outside the audit store).",[743,750,751],{},"To \"forget\" a user, delete their key — the audit row stays, the chain stays valid, the PII becomes unreadable.",[394,753,754,755,758,759,647],{},"A built-in ",[422,756,757],{},"cryptoShredding"," helper is on the ",[554,760,764],{"href":761,"rel":762},"https:\u002F\u002Fgithub.com\u002FHugoRCD\u002Fevlog\u002Fissues",[763],"nofollow","follow-up roadmap",[407,766,768],{"id":767},"retention","Retention",[394,770,771],{},"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:",[773,774,775,788],"table",{},[776,777,778],"thead",{},[779,780,781,785],"tr",{},[782,783,784],"th",{},"Sink",[782,786,787],{},"Retention mechanism",[789,790,791,804,815,823],"tbody",{},[779,792,793,797],{},[794,795,796],"td",{},"FS",[794,798,799,800,803],{},"Combine ",[422,801,802],{},"createFsDrain({ maxFiles })"," with a daily compactor.",[779,805,806,809],{},[794,807,808],{},"Postgres",[794,810,811,812,647],{},"Schedule ",[422,813,814],{},"DELETE FROM audit_events WHERE timestamp \u003C now() - interval '7 years'",[779,816,817,820],{},[794,818,819],{},"Axiom \u002F Datadog \u002F Loki",[794,821,822],{},"Set the dataset retention policy in the platform.",[779,824,825,828],{},[794,826,827],{},"S3 Object Lock",[794,829,830],{},"Configure lifecycle rules + Object Lock retention period.",[394,832,833],{},"Document the chosen window in your security policy. Auditors care about the written rule, not the enforcing component.",[407,835,837],{"id":836},"common-pitfalls","Common Pitfalls",[839,840,841,854,877,883,902,916],"ul",{},[743,842,843,846,847,541,850,853],{},[398,844,845],{},"Logging only successes."," Auditors care most about denials. Always pair ",[422,848,849],{},"log.audit()",[422,851,852],{},"log.audit.deny()"," on the negative branch of every authorisation check.",[743,855,856,862,863,866,867,869,870,708,872,708,874,876],{},[398,857,858,859,647],{},"Leaking PII through ",[422,860,861],{},"changes"," ",[422,864,865],{},"auditDiff()"," runs through your ",[422,868,568],{},", but only if the field paths are listed. Add ",[422,871,707],{},[422,873,711],{},[422,875,714],{},", etc. once globally so you never have to think about it again.",[743,878,879,882],{},[398,880,881],{},"Treating audits as observability."," Don't sample, downsample, or summarise audit events. Force-keep is on by default — don't disable it.",[743,884,885,862,892,894,895,700,898,901],{},[398,886,887,888,891],{},"Conflating ",[422,889,890],{},"actor.id"," with the session id.",[422,893,890],{}," is the stable user id (or system identity). Correlate sessions via ",[422,896,897],{},"context.requestId",[422,899,900],{},"context.traceId",", never via the actor.",[743,903,904,907,908,911,912,915],{},[398,905,906],{},"Forgetting standalone jobs."," Cron tasks, queue workers, and CLIs trigger audit-worthy actions too. Use ",[422,909,910],{},"audit()"," (no request) or ",[422,913,914],{},"withAudit()"," to keep coverage parity with your HTTP routes.",[743,917,918,925],{},[398,919,920,921,924],{},"Skipping ",[422,922,923],{},"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.",[927,928,929],"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":420,"searchDepth":439,"depth":439,"links":931},[932,933,934,935,936],{"id":409,"depth":439,"text":410},{"id":561,"depth":439,"text":562},{"id":734,"depth":439,"text":735},{"id":767,"depth":439,"text":768},{"id":836,"depth":439,"text":837},"Integrity, redact presets, GDPR vs append-only, retention windows, and the most common pitfalls when shipping audit logs to production.","md",[940,943],{"label":557,"icon":145,"to":143,"color":941,"variant":942},"neutral","subtle",{"label":151,"icon":154,"to":152,"color":941,"variant":942},{},{"title":147,"icon":124},{"title":147,"description":937},"9nYNK48OSIcIImz9urmxYL_7YBamnEP9CSpFHEIFdUM",[949,951],{"title":142,"path":143,"stem":144,"description":950,"icon":145,"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":151,"path":152,"stem":153,"description":952,"icon":154,"children":-1},"File system, Axiom, and Postgres recipes for audit logs, plus mockAudit for tests and the full API reference.",1777982710090]