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