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