From f7afc528e891891322f1b7775421b8d986550901 Mon Sep 17 00:00:00 2001 From: kiwiidb Date: Thu, 10 Aug 2023 17:48:38 +0200 Subject: [PATCH] add some more fields for invoice logging --- service.go | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/service.go b/service.go index 66c567f..91ae7c1 100644 --- a/service.go +++ b/service.go @@ -315,11 +315,11 @@ func (svc *Service) ProcessPayment(ctx context.Context, payment *lnrpc.Payment) } logrus.WithFields( logrus.Fields{ - "payload_type": "payment", - "status": fmt.Sprintf("%s", payment.Status), - "latency": time.Since(startTime).Seconds(), - "amount": payment.ValueSat, - "payment_hash": payment.PaymentHash, + "payload_type": "payment", + "status": fmt.Sprintf("%s", payment.Status), + "rabbitmq_latency": time.Since(startTime).Seconds(), + "amount": payment.ValueSat, + "payment_hash": payment.PaymentHash, }).Info("published payment") } @@ -340,10 +340,13 @@ func (svc *Service) ProcessInvoice(ctx context.Context, invoice *lnrpc.Invoice) } logrus.WithFields( logrus.Fields{ - "payload_type": "invoice", - "latency": time.Since(startTime).Seconds(), - "amount": invoice.AmtPaidSat, - "payment_hash": hex.EncodeToString(invoice.RHash), + "payload_type": "invoice", + "rabbitmq_latency": time.Since(startTime).Seconds(), + "amount": invoice.AmtPaidSat, + "keysend": invoice.IsKeysend, + "add_index": invoice.AddIndex, + "settle_date": invoice.SettleDate, + "payment_hash": hex.EncodeToString(invoice.RHash), }).Info("published invoice") //add it to the database if we have one if svc.db != nil {