diff --git a/internal/infrastructure/messaging/messaging_repository.go b/internal/infrastructure/messaging/messaging_repository.go index 01b7742..b708a01 100644 --- a/internal/infrastructure/messaging/messaging_repository.go +++ b/internal/infrastructure/messaging/messaging_repository.go @@ -461,20 +461,20 @@ func (r *MessagingRepository) HealthCheck(ctx context.Context) error { // Check basic connection state if r.conn == nil { - r.logger.Error("NATS health check failed: connection is nil") + r.logger.Warn("NATS health check failed: connection is nil") return fmt.Errorf("%s: NATS connection is nil", constants.ErrHealthCheck) } r.logger.Debug("NATS connection diagnostics", "status", r.conn.Status().String(), "connected", r.conn.IsConnected()) if !r.conn.IsConnected() { - r.logger.Error("NATS health check failed: connection not connected", "status", r.conn.Status().String()) + r.logger.Warn("NATS health check failed: connection not connected", "status", r.conn.Status().String()) return fmt.Errorf("%s: NATS connection is not connected", constants.ErrHealthCheck) } // Check if we can get server info if r.conn.Status() != nats.CONNECTED { - r.logger.Error("NATS health check failed: connection status not connected", + r.logger.Warn("NATS health check failed: connection status not connected", "status", r.conn.Status().String(), "expected", nats.CONNECTED.String()) return fmt.Errorf("%s: NATS connection status is not connected: %s", constants.ErrHealthCheck, r.conn.Status()) diff --git a/internal/infrastructure/storage/storage_repository.go b/internal/infrastructure/storage/storage_repository.go index ea6ef69..38eb268 100644 --- a/internal/infrastructure/storage/storage_repository.go +++ b/internal/infrastructure/storage/storage_repository.go @@ -431,13 +431,13 @@ func (r *StorageRepository) HealthCheck(ctx context.Context) error { res, err := req.Do(ctx, r.client) if err != nil { - logger.Error("Failed to execute health check request", "error", err.Error()) + logger.Warn("OpenSearch health check failed", "error", err.Error()) return fmt.Errorf("%s: %w", constants.ErrHealthCheck, err) } defer res.Body.Close() if res.IsError() { - logger.Error("Health check request failed", "status", res.Status()) + logger.Warn("OpenSearch health check returned error status", "status", res.Status()) return fmt.Errorf("%s: %s", constants.ErrHealthCheck, res.Status()) }