From ac99c5bf5c9902610a7a5f5f31012fc697ab7cc2 Mon Sep 17 00:00:00 2001 From: Kevin Biju Date: Thu, 18 Apr 2024 02:15:25 +0530 Subject: [PATCH] experiment: fix logs --- flow/connectors/connelasticsearch/elasticsearch.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/flow/connectors/connelasticsearch/elasticsearch.go b/flow/connectors/connelasticsearch/elasticsearch.go index 5217c33aff..db324ea0f5 100644 --- a/flow/connectors/connelasticsearch/elasticsearch.go +++ b/flow/connectors/connelasticsearch/elasticsearch.go @@ -168,7 +168,8 @@ func (esc *ElasticsearchConnector) SyncQRepRecords(ctx context.Context, config * bulkIndexErrors = append(bulkIndexErrors, err) } else { bulkIndexErrors = append(bulkIndexErrors, - fmt.Errorf("%s %s %v", res.Error.Type, res.Error.Reason, res.Error.Cause)) + fmt.Errorf("type:%s reason:%s caused by:(%v)", res.Error.Type, + res.Error.Reason, res.Error.Cause)) } }, }) @@ -191,7 +192,9 @@ func (esc *ElasticsearchConnector) SyncQRepRecords(ctx context.Context, config * } bulkIndexerHasShutdown = true if len(bulkIndexErrors) > 0 { - esc.logger.Error("[es] failed to bulk index records", slog.Any("errors", bulkIndexErrors)) + for _, err := range bulkIndexErrors { + esc.logger.Error("[es] failed to index record", slog.Any("err", err)) + } } err = esc.FinishQRepPartition(ctx, partition, config.FlowJobName, startTime)