From 58b0f505b668042bcb3e6d4ea9559d26a5319072 Mon Sep 17 00:00:00 2001 From: Kaushik Iska Date: Sun, 29 Oct 2023 12:38:26 -0400 Subject: [PATCH] better log --- flow/connectors/eventhub/eventhub.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/flow/connectors/eventhub/eventhub.go b/flow/connectors/eventhub/eventhub.go index c604dc68a3..775c6caf80 100644 --- a/flow/connectors/eventhub/eventhub.go +++ b/flow/connectors/eventhub/eventhub.go @@ -202,10 +202,14 @@ func (c *EventHubConnector) processBatch( utcMaxTSString = maxTime.UTC().Format(time.RFC3339) } + // log utcMaxTSString, curTimeUTCSTring, difference in seconds + logstmt := fmt.Sprintf("[total] successfully sent %d records to event hub -"+ + " max ts in utc - %s, current time in utc - %s, difference in seconds - %d", + numRecords, utcMaxTSString, time.Now().UTC().Format(time.RFC3339), int(time.Now().UTC().Sub(maxTime).Seconds())) + log.WithFields(log.Fields{ "flowName": flowJobName, - }).Infof("[total] successfully sent %d records to event hub - max ts in utc - %s", - numRecords, utcMaxTSString) + }).Infof(logstmt) return uint32(numRecords), nil }