feat(logging): emit sanitized structured app logs
This commit is contained in:
@@ -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',
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user