[{"data":1,"prerenderedAt":988},["ShallowReactive",2],{"navigation_docs":3,"-nuxthub-overview":166,"-nuxthub-overview-surround":983},[4,30,55,105,122,136],{"title":5,"path":6,"stem":7,"children":8,"page":29},"Getting Started","/getting-started","1.getting-started",[9,14,19,24],{"title":10,"path":11,"stem":12,"icon":13},"Introduction","/getting-started/introduction","1.getting-started/1.introduction","i-lucide-info",{"title":15,"path":16,"stem":17,"icon":18},"Installation","/getting-started/installation","1.getting-started/2.installation","i-lucide-download",{"title":20,"path":21,"stem":22,"icon":23},"Quick Start","/getting-started/quick-start","1.getting-started/3.quick-start","i-lucide-zap",{"title":25,"path":26,"stem":27,"icon":28},"Agent Skills","/getting-started/agent-skills","1.getting-started/4.agent-skills","i-lucide-sparkles",false,{"title":31,"path":32,"stem":33,"children":34,"page":29},"Core Concepts","/core-concepts","2.core-concepts",[35,40,45,50],{"title":36,"path":37,"stem":38,"icon":39},"Wide Events","/core-concepts/wide-events","2.core-concepts/1.wide-events","i-lucide-layers",{"title":41,"path":42,"stem":43,"icon":44},"Structured Errors","/core-concepts/structured-errors","2.core-concepts/2.structured-errors","i-lucide-shield-alert",{"title":46,"path":47,"stem":48,"icon":49},"Best Practices","/core-concepts/best-practices","2.core-concepts/3.best-practices","i-lucide-shield-check",{"title":51,"path":52,"stem":53,"icon":54},"Typed Fields","/core-concepts/typed-fields","2.core-concepts/4.typed-fields","i-simple-icons-typescript",{"title":56,"path":57,"stem":58,"children":59,"page":29},"Adapters","/adapters","3.adapters",[60,65,70,75,80,85,90,95,100],{"title":61,"path":62,"stem":63,"icon":64},"Overview","/adapters/overview","3.adapters/1.overview","i-custom-plug",{"title":66,"path":67,"stem":68,"icon":69},"Axiom","/adapters/axiom","3.adapters/2.axiom","i-custom-axiom",{"title":71,"path":72,"stem":73,"icon":74},"OTLP","/adapters/otlp","3.adapters/3.otlp","i-simple-icons-opentelemetry",{"title":76,"path":77,"stem":78,"icon":79},"PostHog","/adapters/posthog","3.adapters/4.posthog","i-simple-icons-posthog",{"title":81,"path":82,"stem":83,"icon":84},"Sentry","/adapters/sentry","3.adapters/5.sentry","i-simple-icons-sentry",{"title":86,"path":87,"stem":88,"icon":89},"Better Stack","/adapters/better-stack","3.adapters/6.better-stack","i-simple-icons-betterstack",{"title":91,"path":92,"stem":93,"icon":94},"Custom Adapters","/adapters/custom","3.adapters/7.custom","i-lucide-code",{"title":96,"path":97,"stem":98,"icon":99},"Pipeline","/adapters/pipeline","3.adapters/8.pipeline","i-lucide-workflow",{"title":101,"path":102,"stem":103,"icon":104},"Browser","/adapters/browser","3.adapters/9.browser","i-lucide-globe",{"title":106,"path":107,"stem":108,"children":109,"page":29},"Enrichers","/enrichers","4.enrichers",[110,113,118],{"title":61,"path":111,"stem":112,"icon":28},"/enrichers/overview","4.enrichers/1.overview",{"title":114,"path":115,"stem":116,"icon":117},"Built-in","/enrichers/built-in","4.enrichers/2.built-in","i-lucide-puzzle",{"title":119,"path":120,"stem":121,"icon":94},"Custom","/enrichers/custom","4.enrichers/3.custom",{"title":123,"path":124,"stem":125,"children":126,"page":29},"NuxtHub","/nuxthub","5.nuxthub",[127,131],{"title":61,"path":128,"stem":129,"icon":130},"/nuxthub/overview","5.nuxthub/1.overview","i-lucide-database",{"title":132,"path":133,"stem":134,"icon":135},"Retention","/nuxthub/retention","5.nuxthub/2.retention","i-lucide-clock",{"title":137,"path":138,"stem":139,"children":140,"page":29},"Examples","/examples","6.examples",[141,146,151,156,161],{"title":142,"path":143,"stem":144,"icon":145},"Next.js","/examples/nextjs","6.examples/1.nextjs","i-simple-icons-nextdotjs",{"title":147,"path":148,"stem":149,"icon":150},"TanStack Start","/examples/tanstack-start","6.examples/2.tanstack-start","i-custom-tanstack",{"title":152,"path":153,"stem":154,"icon":155},"Hono","/examples/hono","6.examples/3.hono","i-simple-icons-hono",{"title":157,"path":158,"stem":159,"icon":160},"Express","/examples/express","6.examples/4.express","i-simple-icons-express",{"title":162,"path":163,"stem":164,"icon":165},"Elysia","/examples/elysia","6.examples/5.elysia","i-custom-elysia",{"id":167,"title":168,"body":169,"description":970,"extension":971,"links":972,"meta":979,"navigation":980,"path":128,"seo":981,"stem":129,"__hash__":982},"docs/5.nuxthub/1.overview.md","NuxtHub Storage",{"type":170,"value":171,"toc":959},"minimark",[172,180,185,188,217,222,226,306,313,335,339,345,459,472,475,505,523,527,535,545,550,560,779,796,800,803,821,828,832,840,943,947,955],[173,174,175,179],"p",{},[176,177,178],"code",{},"@evlog/nuxthub"," stores your evlog wide events directly in your NuxtHub database. No external logging service needed — your logs live next to your data, with automatic cleanup based on a retention policy.",[181,182,184],"h2",{"id":183},"why-self-hosted-logs","Why Self-Hosted Logs?",[173,186,187],{},"External logging services (Axiom, Datadog, etc.) are great for production at scale. But sometimes you want:",[189,190,191,199,205,211],"ul",{},[192,193,194,198],"li",{},[195,196,197],"strong",{},"Zero external dependencies"," — logs stored in the same database as your app",[192,200,201,204],{},[195,202,203],{},"Full data ownership"," — no third-party access to your log data",[192,206,207,210],{},[195,208,209],{},"Free tier friendly"," — no per-event pricing, just your existing database",[192,212,213,216],{},[195,214,215],{},"Development & staging"," — full log visibility without paying for a service",[173,218,219,221],{},[176,220,178],{}," works as a drop-in drain. Your existing evlog setup stays the same — you just get a database-backed storage layer on top.",[181,223,225],{"id":224},"install","Install",[227,228,229,257,274,290],"code-group",{},[230,231,237],"pre",{"className":232,"code":233,"filename":234,"language":235,"meta":236,"style":236},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm add @nuxthub/core @evlog/nuxthub\n","pnpm","bash","",[176,238,239],{"__ignoreMap":236},[240,241,244,247,251,254],"span",{"class":242,"line":243},"line",1,[240,245,234],{"class":246},"sBMFI",[240,248,250],{"class":249},"sfazB"," add",[240,252,253],{"class":249}," @nuxthub/core",[240,255,256],{"class":249}," @evlog/nuxthub\n",[230,258,261],{"className":232,"code":259,"filename":260,"language":235,"meta":236,"style":236},"npm install @nuxthub/core @evlog/nuxthub\n","npm",[176,262,263],{"__ignoreMap":236},[240,264,265,267,270,272],{"class":242,"line":243},[240,266,260],{"class":246},[240,268,269],{"class":249}," install",[240,271,253],{"class":249},[240,273,256],{"class":249},[230,275,278],{"className":232,"code":276,"filename":277,"language":235,"meta":236,"style":236},"yarn add @nuxthub/core @evlog/nuxthub\n","yarn",[176,279,280],{"__ignoreMap":236},[240,281,282,284,286,288],{"class":242,"line":243},[240,283,277],{"class":246},[240,285,250],{"class":249},[240,287,253],{"class":249},[240,289,256],{"class":249},[230,291,294],{"className":232,"code":292,"filename":293,"language":235,"meta":236,"style":236},"bun add @nuxthub/core @evlog/nuxthub\n","bun",[176,295,296],{"__ignoreMap":236},[240,297,298,300,302,304],{"class":242,"line":243},[240,299,293],{"class":246},[240,301,250],{"class":249},[240,303,253],{"class":249},[240,305,256],{"class":249},[173,307,308,309,312],{},"Or with ",[176,310,311],{},"nuxi",":",[230,314,316],{"className":232,"code":315,"language":235,"meta":236,"style":236},"npx nuxi module add @nuxthub/core @evlog/nuxthub\n",[176,317,318],{"__ignoreMap":236},[240,319,320,323,326,329,331,333],{"class":242,"line":243},[240,321,322],{"class":246},"npx",[240,324,325],{"class":249}," nuxi",[240,327,328],{"class":249}," module",[240,330,250],{"class":249},[240,332,253],{"class":249},[240,334,256],{"class":249},[181,336,338],{"id":337},"setup","Setup",[173,340,341,342,312],{},"Add the module to your ",[176,343,344],{},"nuxt.config.ts",[230,346,350],{"className":347,"code":348,"filename":344,"language":349,"meta":236,"style":236},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export default defineNuxtConfig({\n  modules: ['@nuxthub/core', '@evlog/nuxthub'],\n\n  evlog: {\n    retention: '7d',\n  },\n})\n","typescript",[176,351,352,373,409,416,427,444,450],{"__ignoreMap":236},[240,353,354,358,361,365,369],{"class":242,"line":243},[240,355,357],{"class":356},"s7zQu","export",[240,359,360],{"class":356}," default",[240,362,364],{"class":363},"s2Zo4"," defineNuxtConfig",[240,366,368],{"class":367},"sTEyZ","(",[240,370,372],{"class":371},"sMK4o","{\n",[240,374,376,380,382,385,388,391,393,396,399,401,403,406],{"class":242,"line":375},2,[240,377,379],{"class":378},"swJcz","  modules",[240,381,312],{"class":371},[240,383,384],{"class":367}," [",[240,386,387],{"class":371},"'",[240,389,390],{"class":249},"@nuxthub/core",[240,392,387],{"class":371},[240,394,395],{"class":371},",",[240,397,398],{"class":371}," '",[240,400,178],{"class":249},[240,402,387],{"class":371},[240,404,405],{"class":367},"]",[240,407,408],{"class":371},",\n",[240,410,412],{"class":242,"line":411},3,[240,413,415],{"emptyLinePlaceholder":414},true,"\n",[240,417,419,422,424],{"class":242,"line":418},4,[240,420,421],{"class":378},"  evlog",[240,423,312],{"class":371},[240,425,426],{"class":371}," {\n",[240,428,430,433,435,437,440,442],{"class":242,"line":429},5,[240,431,432],{"class":378},"    retention",[240,434,312],{"class":371},[240,436,398],{"class":371},[240,438,439],{"class":249},"7d",[240,441,387],{"class":371},[240,443,408],{"class":371},[240,445,447],{"class":242,"line":446},6,[240,448,449],{"class":371},"  },\n",[240,451,453,456],{"class":242,"line":452},7,[240,454,455],{"class":371},"}",[240,457,458],{"class":367},")\n",[173,460,461,462,464,465,467,468,471],{},"Even if ",[176,463,178],{}," can auto-register missing modules, we recommend explicitly installing ",[176,466,390],{}," and registering it in ",[176,469,470],{},"modules"," for a clearer and more predictable setup.",[173,473,474],{},"That's it. The module automatically:",[476,477,478,488,495,502],"ol",{},[192,479,480,481,484,485,487],{},"Installs ",[176,482,483],{},"evlog/nuxt"," and ",[176,486,390],{}," if not already registered",[192,489,490,491,494],{},"Registers the ",[176,492,493],{},"evlog_events"," database schema with NuxtHub",[192,496,497,498,501],{},"Hooks into ",[176,499,500],{},"evlog:drain"," to store every event in the database",[192,503,504],{},"Schedules a cleanup task based on your retention policy",[506,507,509,512,513,519,520,522],"callout",{"color":508,"icon":13},"info",[195,510,511],{},"Prerequisites:"," Your project must use ",[514,515,123],"a",{"href":516,"rel":517},"https://hub.nuxt.com",[518],"nofollow"," with a database configured. ",[176,521,178],{}," uses Drizzle ORM to interact with the database.",[181,524,526],{"id":525},"how-it-works","How It Works",[230,528,533],{"className":529,"code":531,"language":532},[530],"language-text","Request → evlog wide event → evlog:drain hook → INSERT into evlog_events table\n                                                          ↓\n                          Cron task (automatic) → DELETE events older than retention\n","text",[176,534,531],{"__ignoreMap":236},[173,536,537,538,540,541,544],{},"Every wide event emitted by evlog is stored as a row in the ",[176,539,493],{}," table. The drain plugin handles both single events and batches (when used with the ",[514,542,543],{"href":97},"pipeline",").",[546,547,549],"h3",{"id":548},"database-schema","Database Schema",[173,551,552,553,555,556,559],{},"The ",[176,554,493],{}," table stores indexed columns for fast querying and a ",[176,557,558],{},"data"," JSON column for all remaining fields:",[561,562,563,579],"table",{},[564,565,566],"thead",{},[567,568,569,573,576],"tr",{},[570,571,572],"th",{},"Column",[570,574,575],{},"Type",[570,577,578],{},"Description",[580,581,582,597,611,625,639,653,667,681,696,710,724,738,752,765],"tbody",{},[567,583,584,590,594],{},[585,586,587],"td",{},[176,588,589],{},"id",[585,591,592],{},[176,593,532],{},[585,595,596],{},"UUID primary key",[567,598,599,604,608],{},[585,600,601],{},[176,602,603],{},"timestamp",[585,605,606],{},[176,607,532],{},[585,609,610],{},"Event timestamp",[567,612,613,618,622],{},[585,614,615],{},[176,616,617],{},"level",[585,619,620],{},[176,621,532],{},[585,623,624],{},"Log level (info, warn, error, debug)",[567,626,627,632,636],{},[585,628,629],{},[176,630,631],{},"service",[585,633,634],{},[176,635,532],{},[585,637,638],{},"Service name",[567,640,641,646,650],{},[585,642,643],{},[176,644,645],{},"environment",[585,647,648],{},[176,649,532],{},[585,651,652],{},"Environment (production, staging, etc.)",[567,654,655,660,664],{},[585,656,657],{},[176,658,659],{},"method",[585,661,662],{},[176,663,532],{},[585,665,666],{},"HTTP method",[567,668,669,674,678],{},[585,670,671],{},[176,672,673],{},"path",[585,675,676],{},[176,677,532],{},[585,679,680],{},"Request path",[567,682,683,688,693],{},[585,684,685],{},[176,686,687],{},"status",[585,689,690],{},[176,691,692],{},"integer",[585,694,695],{},"HTTP status code",[567,697,698,703,707],{},[585,699,700],{},[176,701,702],{},"duration_ms",[585,704,705],{},[176,706,692],{},[585,708,709],{},"Request duration in milliseconds",[567,711,712,717,721],{},[585,713,714],{},[176,715,716],{},"request_id",[585,718,719],{},[176,720,532],{},[585,722,723],{},"Request correlation ID",[567,725,726,731,735],{},[585,727,728],{},[176,729,730],{},"source",[585,732,733],{},[176,734,532],{},[585,736,737],{},"Event source (server, client)",[567,739,740,745,749],{},[585,741,742],{},[176,743,744],{},"error",[585,746,747],{},[176,748,532],{},[585,750,751],{},"Error details (JSON string)",[567,753,754,758,762],{},[585,755,756],{},[176,757,558],{},[585,759,760],{},[176,761,532],{},[585,763,764],{},"All remaining event fields (JSON)",[567,766,767,772,776],{},[585,768,769],{},[176,770,771],{},"created_at",[585,773,774],{},[176,775,532],{},[585,777,778],{},"Row insertion timestamp",[173,780,781,782,784,785,784,787,784,789,784,791,784,793,795],{},"Indexed columns: ",[176,783,603],{},", ",[176,786,617],{},[176,788,631],{},[176,790,687],{},[176,792,716],{},[176,794,771],{},".",[546,797,799],{"id":798},"dialect-support","Dialect Support",[173,801,802],{},"The schema is automatically registered for your NuxtHub database dialect:",[189,804,805,811,816],{},[192,806,807,810],{},[195,808,809],{},"SQLite"," (default for Cloudflare D1)",[192,812,813],{},[195,814,815],{},"MySQL",[192,817,818],{},[195,819,820],{},"PostgreSQL",[173,822,823,824,827],{},"The correct schema is selected via the ",[176,825,826],{},"hub:db:schema:extend"," hook based on your NuxtHub configuration.",[181,829,831],{"id":830},"combining-with-external-adapters","Combining with External Adapters",[173,833,834,836,837,839],{},[176,835,178],{}," doesn't replace external adapters — you can use both. The module registers its own ",[176,838,500],{}," hook, so any other drain plugins you have will still work:",[230,841,844],{"className":347,"code":842,"filename":843,"language":349,"meta":236,"style":236},"import { createAxiomDrain } from 'evlog/axiom'\n\nexport default defineNitroPlugin((nitroApp) => {\n  // This runs alongside @evlog/nuxthub's built-in drain\n  nitroApp.hooks.hook('evlog:drain', createAxiomDrain())\n})\n","server/plugins/evlog-drain.ts",[176,845,846,871,875,901,907,937],{"__ignoreMap":236},[240,847,848,851,854,857,860,863,865,868],{"class":242,"line":243},[240,849,850],{"class":356},"import",[240,852,853],{"class":371}," {",[240,855,856],{"class":367}," createAxiomDrain",[240,858,859],{"class":371}," }",[240,861,862],{"class":356}," from",[240,864,398],{"class":371},[240,866,867],{"class":249},"evlog/axiom",[240,869,870],{"class":371},"'\n",[240,872,873],{"class":242,"line":375},[240,874,415],{"emptyLinePlaceholder":414},[240,876,877,879,881,884,886,888,892,895,899],{"class":242,"line":411},[240,878,357],{"class":356},[240,880,360],{"class":356},[240,882,883],{"class":363}," defineNitroPlugin",[240,885,368],{"class":367},[240,887,368],{"class":371},[240,889,891],{"class":890},"sHdIc","nitroApp",[240,893,894],{"class":371},")",[240,896,898],{"class":897},"spNyl"," =>",[240,900,426],{"class":371},[240,902,903],{"class":242,"line":418},[240,904,906],{"class":905},"sHwdD","  // This runs alongside @evlog/nuxthub's built-in drain\n",[240,908,909,912,914,917,919,922,924,926,928,930,932,934],{"class":242,"line":429},[240,910,911],{"class":367},"  nitroApp",[240,913,795],{"class":371},[240,915,916],{"class":367},"hooks",[240,918,795],{"class":371},[240,920,921],{"class":363},"hook",[240,923,368],{"class":378},[240,925,387],{"class":371},[240,927,500],{"class":249},[240,929,387],{"class":371},[240,931,395],{"class":371},[240,933,856],{"class":363},[240,935,936],{"class":378},"())\n",[240,938,939,941],{"class":242,"line":446},[240,940,455],{"class":371},[240,942,458],{"class":367},[181,944,946],{"id":945},"next-steps","Next Steps",[189,948,949],{},[192,950,951,954],{},[514,952,953],{"href":133},"Retention & Cleanup"," — Configure retention policy and cleanup scheduling",[956,957,958],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}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 .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 .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}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}",{"title":236,"searchDepth":375,"depth":375,"links":960},[961,962,963,964,968,969],{"id":183,"depth":375,"text":184},{"id":224,"depth":375,"text":225},{"id":337,"depth":375,"text":338},{"id":525,"depth":375,"text":526,"children":965},[966,967],{"id":548,"depth":411,"text":549},{"id":798,"depth":411,"text":799},{"id":830,"depth":375,"text":831},{"id":945,"depth":375,"text":946},"Self-hosted log retention for evlog using NuxtHub database storage. Store, query, and automatically clean up your structured logs with zero external dependencies.","md",[973,978],{"label":123,"icon":974,"to":516,"target":975,"color":976,"variant":977},"i-lucide-external-link","_blank","neutral","subtle",{"label":56,"icon":64,"to":62,"color":976,"variant":977},{},{"title":61,"icon":130},{"title":168,"description":970},"F5e3TvYQeqA50ikCUEtSClNVaxTBoTDzLW2Svq_BEQs",[984,986],{"title":119,"path":120,"stem":121,"description":985,"icon":94,"children":-1},"Write custom enrichers to add derived context to your wide events. Add deployment metadata, tenant IDs, feature flags, or any computed data.",{"title":132,"path":133,"stem":134,"description":987,"icon":135,"children":-1},"Configure how long logs are kept in NuxtHub and how they are automatically cleaned up with scheduled tasks, cron jobs, and retention policies.",1772879912898]