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