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

@@ -8,6 +8,7 @@ import { ERROR_CODES } from "../../constants/errorCodes";
import { AppError } from "../../utils/errors";
import { SeriesService } from "./series.service";
import type { Series } from "@/types/series";
import logger from "@/lib/logger";
export class BookService extends BaseApiService {
private static async getImageCacheMaxAge(): Promise<number> {
@@ -16,7 +17,7 @@ export class BookService extends BaseApiService {
const maxAge = ttlConfig?.imageCacheMaxAge ?? 2592000;
return maxAge;
} catch (error) {
console.error('[ImageCache] Error fetching TTL config:', error);
logger.error({ err: error }, '[ImageCache] Error fetching TTL config');
return 2592000; // 30 jours par défaut en cas d'erreur
}
}