feat: enhance error logging in Anthropic and OpenAI handlers with client IP information
This commit is contained in:
+2
-2
@@ -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),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user