Guides / Monitoring
Every logit.now() call has three optional fields for context:
| Field | Type | Purpose |
|---|---|---|
description | string | Human-readable context shown in the event list |
tags | Record<string, string> | Filterable key-value pairs — shown as chips in the dashboard |
metadata | Record<string, unknown> | Full structured data — shown in event detail panel |
// ❌ Too vague — not useful in a list
description: "Payment failed"
// ✅ Immediately useful
description: "alex@example.com — insufficient_funds — $49.00"
// ❌ Everything in metadata — can't filter in dashboard
metadata: { plan: "pro", country: "US", currency: "usd" }
// ✅ Filterable dimensions in tags
tags: { plan: "pro", country: "US", currency: "usd" }
// ✅ High-cardinality values go in metadata
metadata: { userId: "usr_abc123", stripeCustomerId: "cus_xyz456", rawError: "card_declined" }
await logit.now("payments", {
event: "Payment failed",
description: `${customer.email} — ${error.code} — ${formatCurrency(amount, currency)}`,
icon: "❌",
notify: false,
tags: {
plan: customer.plan,
currency: currency,
declineCode: error.decline_code ?? "none",
country: customer.country ?? "unknown",
},
metadata: {
customerId: customer.id,
stripeCustomerId: customer.stripeId,
amount,
errorMessage: error.message,
paymentIntentId: intent.id,
},
});
description — it's the first thing you look at during an incident.metadata.stack for immediate debuggability.Try LogIt free
7-day trial. No credit card required.