Worker Logs & Additional Bindings
@nuxthub/core >= v0.8.25
Worker projects on NuxtHub can now enable Worker Logs, and associate additional bindings to deployments all from within the NuxtHub config. This opens the possibility of adding additional databases, R2 buckets, service bindings, rate limiting, queues and more to projects.
Worker Logs
Workers Logs lets you automatically collect, store, filter, and analyze logging data emitted from your Nuxt app. Currently, you can query it in the dashboard for each of your Workers projects within the Cloudflare Dashboard.
Logs include invocation logs, custom logs, errors, and uncaught exceptions.
Enable Worker Logs within hub.bindings.observability.logs
in your nuxt.config.ts
.
export default defineNuxtConfig({
hub: {
bindings: {
observability: {
// enable with default settings
logs: true,
// customise settings
logs: {
head_sampling_rate: 0.5,
invocation_logs: false
}
}
}
},
Additional bindings
Additional bindings can be configured within hub.bindings
in your nuxt.config.ts
. All options are suggested via IntelliSense, however, you can refer to Cloudflare's API documentation too.
Resources for additional bindings are not provisioned automatically like they are with NuxtHub features such as hub.database
. You will need to create the resources manually from the Cloudflare dashboard.
export default defineNuxtConfig({
hub: {
bindings: {
// <binding type>: {
// <BINDING NAME>: {
// // binding options
// }
// }
// additional cloudflare bindings
analytics_engine: {
ANALYTICS_TESTING: {
dataset: 'testing'
}
},
mtls_certificate: {
CERT: {
certificate_id: '<CERTIFICATE_ID>'
}
}
}
},