feat: add logging enhancements by integrating pino and pino-pretty for improved error tracking and debugging across the application

This commit is contained in:
Julien Froidefond
2025-10-26 06:15:47 +01:00
parent 7cc72dc13d
commit 52350a43d9
84 changed files with 455 additions and 177 deletions

View File

@@ -1,5 +1,6 @@
import { NextRequest } from "next/server";
import { getToken } from "next-auth/jwt";
import logger from "@/lib/logger";
export async function getAuthSession(request: NextRequest) {
try {
@@ -20,7 +21,7 @@ export async function getAuthSession(request: NextRequest) {
}
};
} catch (error) {
console.error("Auth error in middleware:", error);
logger.error({ err: error }, "Auth error in middleware");
return null;
}
}