Add api logging

This commit is contained in:
2026-06-29 21:11:26 +02:00
parent c490344cb6
commit bebe3564d6
+12
View File
@@ -0,0 +1,12 @@
import { getUserSession } from '#imports';
export default defineEventHandler(async (event) => {
const { method, path } = event;
if (path.startsWith('/api/metrics')) {
return;
}
const { user } = await getUserSession(event);
const ip = getRequestIP(event, { xForwardedFor: true });
console.log('--> ', ip ?? '???', user?.id ?? 'Anon', method, path);
});