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