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