feat: enhance error logging in Anthropic and OpenAI handlers with client IP information

This commit is contained in:
Beyhan Ogur
2026-05-11 20:54:09 +03:00
parent 74b9cb517a
commit 80c75ec40f
2 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -86,8 +86,8 @@ func OpenAIHandler(cfg *config.Config, db *gorm.DB) fiber.Handler {
}
if err != nil {
logger.Warn("│ ❌ UPSTREAM ERROR: %v", err)
logger.Warn("└─ [OPENAI] <<< 502 (%dms)", latency)
logger.Warn("│ ❌ UPSTREAM ERROR [IP: %s]: %v", c.IP(), err)
logger.Warn("└─ [OPENAI] <<< 502 (%dms) | IP: %s", latency, c.IP())
return c.Status(fiber.StatusBadGateway).JSON(fiber.Map{
"error": fmt.Sprintf("upstream error: %v", err),
})