[{"data":1,"prerenderedAt":778},["ShallowReactive",2],{"navigation_docs":3,"-nuxthub-retention":219,"-nuxthub-retention-surround":774},[4,30,105,139,188,205],{"title":5,"path":6,"stem":7,"children":8,"page":29},"Getting Started","/getting-started","1.getting-started",[9,14,19,24],{"title":10,"path":11,"stem":12,"icon":13},"Introduction","/getting-started/introduction","1.getting-started/1.introduction","i-lucide-info",{"title":15,"path":16,"stem":17,"icon":18},"Installation","/getting-started/installation","1.getting-started/2.installation","i-lucide-download",{"title":20,"path":21,"stem":22,"icon":23},"Quick Start","/getting-started/quick-start","1.getting-started/3.quick-start","i-lucide-zap",{"title":25,"path":26,"stem":27,"icon":28},"Agent Skills","/getting-started/agent-skills","1.getting-started/4.agent-skills","i-lucide-sparkles",false,{"title":31,"path":32,"stem":33,"children":34,"page":29},"Frameworks","/frameworks","2.frameworks",[35,40,45,50,55,60,65,70,75,80,85,90,95,100],{"title":36,"path":37,"stem":38,"icon":39},"Overview","/frameworks/overview","2.frameworks/00.overview","i-lucide-layout-grid",{"title":41,"path":42,"stem":43,"icon":44},"Nuxt","/frameworks/nuxt","2.frameworks/01.nuxt","i-simple-icons-nuxtdotjs",{"title":46,"path":47,"stem":48,"icon":49},"Next.js","/frameworks/nextjs","2.frameworks/02.nextjs","i-simple-icons-nextdotjs",{"title":51,"path":52,"stem":53,"icon":54},"SvelteKit","/frameworks/sveltekit","2.frameworks/03.sveltekit","i-simple-icons-svelte",{"title":56,"path":57,"stem":58,"icon":59},"Nitro","/frameworks/nitro","2.frameworks/04.nitro","i-custom-nitro",{"title":61,"path":62,"stem":63,"icon":64},"TanStack Start","/frameworks/tanstack-start","2.frameworks/05.tanstack-start","i-custom-tanstack",{"title":66,"path":67,"stem":68,"icon":69},"NestJS","/frameworks/nestjs","2.frameworks/06.nestjs","i-simple-icons-nestjs",{"title":71,"path":72,"stem":73,"icon":74},"Express","/frameworks/express","2.frameworks/07.express","i-simple-icons-express",{"title":76,"path":77,"stem":78,"icon":79},"Hono","/frameworks/hono","2.frameworks/08.hono","i-simple-icons-hono",{"title":81,"path":82,"stem":83,"icon":84},"Fastify","/frameworks/fastify","2.frameworks/09.fastify","i-simple-icons-fastify",{"title":86,"path":87,"stem":88,"icon":89},"Elysia","/frameworks/elysia","2.frameworks/10.elysia","i-custom-elysia",{"title":91,"path":92,"stem":93,"icon":94},"Cloudflare Workers","/frameworks/cloudflare-workers","2.frameworks/11.cloudflare-workers","i-simple-icons-cloudflare",{"title":96,"path":97,"stem":98,"icon":99},"Standalone","/frameworks/standalone","2.frameworks/12.standalone","i-simple-icons-typescript",{"title":101,"path":102,"stem":103,"icon":104},"Astro","/frameworks/astro","2.frameworks/13.astro","i-simple-icons-astro",{"title":106,"path":107,"stem":108,"children":109,"page":29},"Core Concepts","/core-concepts","3.core-concepts",[110,115,120,125,129,134],{"title":111,"path":112,"stem":113,"icon":114},"Wide Events","/core-concepts/wide-events","3.core-concepts/1.wide-events","i-lucide-layers",{"title":116,"path":117,"stem":118,"icon":119},"Structured Errors","/core-concepts/structured-errors","3.core-concepts/2.structured-errors","i-lucide-shield-alert",{"title":121,"path":122,"stem":123,"icon":124},"Best Practices","/core-concepts/best-practices","3.core-concepts/3.best-practices","i-lucide-shield-check",{"title":126,"path":127,"stem":128,"icon":99},"Typed Fields","/core-concepts/typed-fields","3.core-concepts/4.typed-fields",{"title":130,"path":131,"stem":132,"icon":133},"Sampling","/core-concepts/sampling","3.core-concepts/5.sampling","i-lucide-filter",{"title":135,"path":136,"stem":137,"icon":138},"Client Logging","/core-concepts/client-logging","3.core-concepts/6.client-logging","i-lucide-monitor",{"title":140,"path":141,"stem":142,"children":143,"page":29},"Adapters","/adapters","4.adapters",[144,148,153,158,163,168,173,178,183],{"title":36,"path":145,"stem":146,"icon":147},"/adapters/overview","4.adapters/1.overview","i-custom-plug",{"title":149,"path":150,"stem":151,"icon":152},"Axiom","/adapters/axiom","4.adapters/2.axiom","i-custom-axiom",{"title":154,"path":155,"stem":156,"icon":157},"OTLP","/adapters/otlp","4.adapters/3.otlp","i-simple-icons-opentelemetry",{"title":159,"path":160,"stem":161,"icon":162},"PostHog","/adapters/posthog","4.adapters/4.posthog","i-simple-icons-posthog",{"title":164,"path":165,"stem":166,"icon":167},"Sentry","/adapters/sentry","4.adapters/5.sentry","i-simple-icons-sentry",{"title":169,"path":170,"stem":171,"icon":172},"Better Stack","/adapters/better-stack","4.adapters/6.better-stack","i-simple-icons-betterstack",{"title":174,"path":175,"stem":176,"icon":177},"Custom Adapters","/adapters/custom","4.adapters/7.custom","i-lucide-code",{"title":179,"path":180,"stem":181,"icon":182},"Pipeline","/adapters/pipeline","4.adapters/8.pipeline","i-lucide-workflow",{"title":184,"path":185,"stem":186,"icon":187},"Browser","/adapters/browser","4.adapters/9.browser","i-lucide-globe",{"title":189,"path":190,"stem":191,"children":192,"page":29},"Enrichers","/enrichers","5.enrichers",[193,196,201],{"title":36,"path":194,"stem":195,"icon":28},"/enrichers/overview","5.enrichers/1.overview",{"title":197,"path":198,"stem":199,"icon":200},"Built-in","/enrichers/built-in","5.enrichers/2.built-in","i-lucide-puzzle",{"title":202,"path":203,"stem":204,"icon":177},"Custom","/enrichers/custom","5.enrichers/3.custom",{"title":206,"path":207,"stem":208,"children":209,"page":29},"NuxtHub","/nuxthub","6.nuxthub",[210,214],{"title":36,"path":211,"stem":212,"icon":213},"/nuxthub/overview","6.nuxthub/1.overview","i-lucide-database",{"title":215,"path":216,"stem":217,"icon":218},"Retention","/nuxthub/retention","6.nuxthub/2.retention","i-lucide-clock",{"id":220,"title":221,"body":222,"description":764,"extension":765,"links":766,"meta":770,"navigation":771,"path":216,"seo":772,"stem":217,"__hash__":773},"docs/6.nuxthub/2.retention.md","Retention & Cleanup",{"type":223,"value":224,"toc":752},"minimark",[225,233,238,245,369,374,377,447,451,458,528,539,543,546,562,566,573,602,605,609,620,707,713,717,724,728,748],[226,227,228,232],"p",{},[229,230,231],"code",{},"@evlog/nuxthub"," automatically deletes old events based on your retention policy. No manual cleanup needed.",[234,235,237],"h2",{"id":236},"configuration","Configuration",[226,239,240,241,244],{},"Set the retention period in your ",[229,242,243],{},"nuxt.config.ts",":",[246,247,252],"pre",{"className":248,"code":249,"filename":243,"language":250,"meta":251,"style":251},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export default defineNuxtConfig({\n  modules: ['@nuxthub/core', '@evlog/nuxthub'],\n\n  evlog: {\n    retention: '7d', // default\n  },\n})\n","typescript","",[229,253,254,278,315,322,333,354,360],{"__ignoreMap":251},[255,256,259,263,266,270,274],"span",{"class":257,"line":258},"line",1,[255,260,262],{"class":261},"s7zQu","export",[255,264,265],{"class":261}," default",[255,267,269],{"class":268},"s2Zo4"," defineNuxtConfig",[255,271,273],{"class":272},"sTEyZ","(",[255,275,277],{"class":276},"sMK4o","{\n",[255,279,281,285,287,290,293,297,299,302,305,307,309,312],{"class":257,"line":280},2,[255,282,284],{"class":283},"swJcz","  modules",[255,286,244],{"class":276},[255,288,289],{"class":272}," [",[255,291,292],{"class":276},"'",[255,294,296],{"class":295},"sfazB","@nuxthub/core",[255,298,292],{"class":276},[255,300,301],{"class":276},",",[255,303,304],{"class":276}," '",[255,306,231],{"class":295},[255,308,292],{"class":276},[255,310,311],{"class":272},"]",[255,313,314],{"class":276},",\n",[255,316,318],{"class":257,"line":317},3,[255,319,321],{"emptyLinePlaceholder":320},true,"\n",[255,323,325,328,330],{"class":257,"line":324},4,[255,326,327],{"class":283},"  evlog",[255,329,244],{"class":276},[255,331,332],{"class":276}," {\n",[255,334,336,339,341,343,346,348,350],{"class":257,"line":335},5,[255,337,338],{"class":283},"    retention",[255,340,244],{"class":276},[255,342,304],{"class":276},[255,344,345],{"class":295},"7d",[255,347,292],{"class":276},[255,349,301],{"class":276},[255,351,353],{"class":352},"sHwdD"," // default\n",[255,355,357],{"class":257,"line":356},6,[255,358,359],{"class":276},"  },\n",[255,361,363,366],{"class":257,"line":362},7,[255,364,365],{"class":276},"}",[255,367,368],{"class":272},")\n",[370,371,373],"h3",{"id":372},"retention-format","Retention Format",[226,375,376],{},"The retention value is a number followed by a unit:",[378,379,380,396],"table",{},[381,382,383],"thead",{},[384,385,386,390,393],"tr",{},[387,388,389],"th",{},"Unit",[387,391,392],{},"Description",[387,394,395],{},"Example",[397,398,399,415,431],"tbody",{},[384,400,401,407,410],{},[402,403,404],"td",{},[229,405,406],{},"d",[402,408,409],{},"Days",[402,411,412,414],{},[229,413,345],{}," = 7 days",[384,416,417,422,425],{},[402,418,419],{},[229,420,421],{},"h",[402,423,424],{},"Hours",[402,426,427,430],{},[229,428,429],{},"24h"," = 24 hours",[384,432,433,438,441],{},[402,434,435],{},[229,436,437],{},"m",[402,439,440],{},"Minutes",[402,442,443,446],{},[229,444,445],{},"60m"," = 60 minutes",[234,448,450],{"id":449},"how-cleanup-works","How Cleanup Works",[226,452,453,454,457],{},"The module registers a Nitro scheduled task (",[229,455,456],{},"evlog:cleanup",") that runs on a cron schedule derived from your retention value. The cron frequency is set to roughly half the retention period:",[378,459,460,471],{},[381,461,462],{},[384,463,464,466,469],{},[387,465,215],{},[387,467,468],{},"Cron Schedule",[387,470,392],{},[397,472,473,487,501,515],{},[384,474,475,479,484],{},[402,476,477],{},[229,478,445],{},[402,480,481],{},[229,482,483],{},"*/30 * * * *",[402,485,486],{},"Every 30 minutes",[384,488,489,493,498],{},[402,490,491],{},[229,492,429],{},[402,494,495],{},[229,496,497],{},"0 */12 * * *",[402,499,500],{},"Every 12 hours",[384,502,503,507,512],{},[402,504,505],{},[229,506,345],{},[402,508,509],{},[229,510,511],{},"0 3 * * *",[402,513,514],{},"Daily at 3:00 AM",[384,516,517,522,526],{},[402,518,519],{},[229,520,521],{},"30d",[402,523,524],{},[229,525,511],{},[402,527,514],{},[226,529,530,531,534,535,538],{},"The cleanup task deletes all rows in ",[229,532,533],{},"evlog_events"," where ",[229,536,537],{},"created_at"," is older than the retention period.",[234,540,542],{"id":541},"manual-cleanup","Manual Cleanup",[226,544,545],{},"You can trigger cleanup manually via the API endpoint:",[246,547,551],{"className":548,"code":549,"language":550,"meta":251,"style":251},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","curl https://your-app.com/api/_cron/evlog-cleanup\n","bash",[229,552,553],{"__ignoreMap":251},[255,554,555,559],{"class":257,"line":258},[255,556,558],{"class":557},"sBMFI","curl",[255,560,561],{"class":295}," https://your-app.com/api/_cron/evlog-cleanup\n",[370,563,565],{"id":564},"cron-secret-protection","Cron Secret Protection",[226,567,568,569,572],{},"If the ",[229,570,571],{},"CRON_SECRET"," environment variable is set, the endpoint requires a Bearer token:",[246,574,576],{"className":548,"code":575,"language":550,"meta":251,"style":251},"curl -H \"Authorization: Bearer your-secret\" \\\n  https://your-app.com/api/_cron/evlog-cleanup\n",[229,577,578,597],{"__ignoreMap":251},[255,579,580,582,585,588,591,594],{"class":257,"line":258},[255,581,558],{"class":557},[255,583,584],{"class":295}," -H",[255,586,587],{"class":276}," \"",[255,589,590],{"class":295},"Authorization: Bearer your-secret",[255,592,593],{"class":276},"\"",[255,595,596],{"class":272}," \\\n",[255,598,599],{"class":257,"line":280},[255,600,601],{"class":295},"  https://your-app.com/api/_cron/evlog-cleanup\n",[226,603,604],{},"This is recommended for production deployments to prevent unauthorized cleanup triggers.",[234,606,608],{"id":607},"vercel-cron","Vercel Cron",[226,610,611,612,615,616,619],{},"When installing the module with ",[229,613,614],{},"nuxi module add",", you'll be prompted to create a ",[229,617,618],{},"vercel.json"," with the appropriate cron schedule:",[246,621,625],{"className":622,"code":623,"filename":618,"language":624,"meta":251,"style":251},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"crons\": [\n    {\n      \"path\": \"/api/_cron/evlog-cleanup\",\n      \"schedule\": \"0 3 * * *\"\n    }\n  ]\n}\n","json",[229,626,627,631,647,652,673,691,696,701],{"__ignoreMap":251},[255,628,629],{"class":257,"line":258},[255,630,277],{"class":276},[255,632,633,636,640,642,644],{"class":257,"line":280},[255,634,635],{"class":276},"  \"",[255,637,639],{"class":638},"spNyl","crons",[255,641,593],{"class":276},[255,643,244],{"class":276},[255,645,646],{"class":276}," [\n",[255,648,649],{"class":257,"line":317},[255,650,651],{"class":276},"    {\n",[255,653,654,657,660,662,664,666,669,671],{"class":257,"line":324},[255,655,656],{"class":276},"      \"",[255,658,659],{"class":557},"path",[255,661,593],{"class":276},[255,663,244],{"class":276},[255,665,587],{"class":276},[255,667,668],{"class":295},"/api/_cron/evlog-cleanup",[255,670,593],{"class":276},[255,672,314],{"class":276},[255,674,675,677,680,682,684,686,688],{"class":257,"line":335},[255,676,656],{"class":276},[255,678,679],{"class":557},"schedule",[255,681,593],{"class":276},[255,683,244],{"class":276},[255,685,587],{"class":276},[255,687,511],{"class":295},[255,689,690],{"class":276},"\"\n",[255,692,693],{"class":257,"line":356},[255,694,695],{"class":276},"    }\n",[255,697,698],{"class":257,"line":362},[255,699,700],{"class":276},"  ]\n",[255,702,704],{"class":257,"line":703},8,[255,705,706],{"class":276},"}\n",[226,708,709,710,712],{},"On Vercel, the ",[229,711,571],{}," environment variable is automatically set and validated.",[234,714,716],{"id":715},"cloudflare-other-platforms","Cloudflare & Other Platforms",[226,718,719,720,723],{},"On Cloudflare Workers and other platforms, the Nitro scheduled task handles cleanup automatically — no additional cron configuration needed. The task is registered with ",[229,721,722],{},"experimental.tasks"," enabled in the Nitro config.",[234,725,727],{"id":726},"next-steps","Next Steps",[729,730,731,738,743],"ul",{},[732,733,734,737],"li",{},[735,736,36],"a",{"href":211}," — Installation and setup",[732,739,740,742],{},[735,741,140],{"href":145}," — Send logs to external services alongside NuxtHub storage",[732,744,745,747],{},[735,746,179],{"href":180}," — Batch events for better database performance",[749,750,751],"style",{},"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}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 .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}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 .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}",{"title":251,"searchDepth":280,"depth":280,"links":753},[754,757,758,761,762,763],{"id":236,"depth":280,"text":237,"children":755},[756],{"id":372,"depth":317,"text":373},{"id":449,"depth":280,"text":450},{"id":541,"depth":280,"text":542,"children":759},[760],{"id":564,"depth":317,"text":565},{"id":607,"depth":280,"text":608},{"id":715,"depth":280,"text":716},{"id":726,"depth":280,"text":727},"Configure how long logs are kept in NuxtHub and how they are automatically cleaned up with scheduled tasks, cron jobs, and retention policies.","md",[767],{"label":36,"icon":213,"to":211,"color":768,"variant":769},"neutral","subtle",{},{"title":215,"icon":218},{"title":221,"description":764},"vh18Q-pwZ-tddlSMysFLV_VMjM19wkBf-2GjxPZMa44",[775,777],{"title":36,"path":211,"stem":212,"description":776,"icon":213,"children":-1},"Self-hosted log retention for evlog using NuxtHub database storage. Store, query, and automatically clean up your structured logs with zero external dependencies.",null,1773097849784]