Files
vat-api.eu/server/utils/requestLogger.ts
2026-02-14 10:14:49 +01:00

18 lines
380 B
TypeScript

export interface RequestLogEntry {
ip: string;
path: string;
method: string;
statusCode: number;
userAgent: string;
timestamp: string;
}
export function logRequest(data: RequestLogEntry): void {
try {
const redis = getRedis();
redis.lpush("request-logs", JSON.stringify(data)).catch(() => {});
} catch {
// Never let logging break API responses
}
}