Skip to content

Commit

Permalink
add some more fields for invoice logging
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwiidb committed Aug 10, 2023
1 parent 2b6719b commit f7afc52
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand All @@ -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 {
Expand Down

0 comments on commit f7afc52

Please sign in to comment.