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