feat(logging): emit sanitized structured app logs
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { MongoClient, Db } from 'mongodb'
|
||||
import { dbLogger, getSafeErrorDetails } from './logger'
|
||||
|
||||
// WHY this file only exposes getDb/checkMongoConnection now: it used to also
|
||||
// export getCollection(), used by src/app/api/contact/route.ts for a raw,
|
||||
@@ -63,7 +64,7 @@ export async function checkMongoConnection(): Promise<boolean> {
|
||||
await db.admin().ping()
|
||||
return true
|
||||
} catch (error) {
|
||||
console.error('MongoDB connection check failed:', error)
|
||||
dbLogger.error('MongoDB connection check failed', getSafeErrorDetails(error))
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user