We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 706a4f2 commit ea310c9Copy full SHA for ea310c9
nuxt.config.ts
@@ -32,6 +32,7 @@ export default defineNuxtConfig({
32
},
33
34
runtimeConfig: {
35
+ logRequests: true,
36
serverHostUrl: "http://localhost:8080",
37
provider: {
38
local: {
server/plugins/log.ts
@@ -0,0 +1,11 @@
1
+export default defineNitroPlugin((nitroApp) => {
2
+ nitroApp.hooks.hook('request', (event) => {
3
+ // Check if requests logging is enabled in config
4
+ if (useRuntimeConfig().logRequests) {
5
+ // Log all requests, except nuxt logic and sensitive callback info
6
+ if (!event.path.includes('_nuxt') && !event.path.includes('/callback')) {
7
+ console.log('[KPI]', event.method, event.path)
8
+ }
9
10
+ })
11
+})
0 commit comments