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