feat(logging): emit sanitized structured app logs

This commit is contained in:
Do Siki
2026-09-28 09:51:40 +02:00
parent 2ad3e75c87
commit b5a8936f42
26 changed files with 429 additions and 574 deletions
+5 -2
View File
@@ -1,4 +1,7 @@
import { NextResponse } from 'next/server';
import { createComponentLogger, getSafeErrorDetails } from '@/lib/logger'
const healthLogger = createComponentLogger('health-api')
export async function GET() {
try {
@@ -23,7 +26,7 @@ export async function GET() {
},
});
} catch (error) {
console.error('Health check error:', error);
healthLogger.error('Health check failed', getSafeErrorDetails(error))
return NextResponse.json(
{
status: 'error',
@@ -43,4 +46,4 @@ export async function HEAD() {
'Cache-Control': 'no-cache, no-store, must-revalidate',
},
});
}
}