Docs

Log Any Business Event

A general recipe for logging anything that affects revenue or retention. Pick a channel, write a clear event name, attach context.


The pattern

Every LogIt event follows the same shape:

ts
await logit.now("<channel>", {
  event: "<what happened>",
  description: "<human-readable one-liner>",
  icon: "<emoji>",
  notify: true,          // optional — push immediately
  tags: { ... },         // low-cardinality filters
  metadata: { ... },     // emails, IDs, amounts
});

Pick a channel

Channels are just strings. Group events the way you think about your product:

ChannelUse for
signupsNew accounts
paymentsCharges, refunds
trialsTrial lifecycle
errorsBusiness-critical failures
featuresFeature usage
churnCancellations, downgrades

Example: subscription cancelled

ts
await logit.now("churn", {
  event: "Subscription cancelled",
  description: `${user.email} cancelled their Pro plan`,
  icon: "👋",
  notify: true,
  tags: { plan: "pro", reason: cancellationReason ?? "unknown" },
  metadata: {
    userId: user.id,
    email: user.email,
    mrrLost: 49,
    tenureDays: daysSince(user.createdAt),
  },
});

Example: usage limit hit

ts
await logit.now("limits", {
  event: "API limit reached",
  description: `${user.email} hit their monthly event cap`,
  icon: "🚧",
  notify: true,
  tags: { plan: user.plan, limit: "events" },
  metadata: { userId: user.id, usage: user.eventCount, cap: user.eventCap },
});

When to log

If you'd open your database or Slack to check — log it instead. If it affects revenue, retention, or your next product decision — it belongs in LogIt.