@evlog/nuxthub
v2.0.0
Published
Self-hosted log retention for evlog using NuxtHub database storage
Maintainers
Readme
@evlog/nuxthub
Self-hosted log retention for evlog using NuxtHub database storage. Store, query, and automatically clean up your structured logs with zero external dependencies.
Setup
Install the packages:
npx nuxi module add @nuxthub/core @evlog/nuxthubAdd the module to your nuxt.config.ts:
export default defineNuxtConfig({
modules: ['@nuxthub/core', '@evlog/nuxthub'],
evlog: {
retention: '7d',
},
})
evlog/nuxtand@nuxthub/corecan be auto-installed if missing, but we recommend installing@nuxthub/coreexplicitly and registering it inmodules.
Configuration
| Option | Type | Default | Description |
| --- | --- | --- | --- |
| retention | string | '7d' | How long to keep events. Accepts d (days), h (hours), or m (minutes). |
The cleanup cron schedule is automatically derived from the retention value.
Database Support
NuxtHub supports multiple database dialects. The evlog_events table schema is automatically registered for:
- SQLite (default for Cloudflare D1)
- MySQL
- PostgreSQL
Deployment
For Vercel deployments, the module can create a vercel.json with the appropriate cron schedule during nuxi module add. For Cloudflare and other platforms, the Nitro scheduled task handles cleanup automatically.
