What to log
What to log in React Native — event taxonomy and minimum instrumentation for error monitoring and crash reporting
Always know who, which build, which screen, and what happened. Prefer stable event names over free-form sentences alone.
Levels
| Level | Use for |
|---|---|
log (info) | Milestones — screen opened, checkout started, order confirmed |
warn | Recoverable weirdness — slow API, retry, empty list after success |
error | Failed user outcomes — even if you catch the exception yourself |
Always attach
- userId via
TraceRN.setUser - release + environment in
TraceRN.init - screen via
trackScreenor breadcrumb data - A stable event key in the message or
extra(e.g.payment.failed)
Event families
Lifecycle
app.openedscreen.viewed(or rely ontrackScreen)auth.signed_in/auth.signed_out
Network
- Auto fetch breadcrumbs for requests
- Optional
slowNetworkThresholdMsin init for slow-fetch warnings - Custom:
api.slow,retry.exhausted,offline.queued
Core product flows
checkout.started→payment.failed/order.confirmedsearch.submitted,filter.appliedupload.started/upload.failed
Data / UI
list.emptyform.validation_failedimage.load_failed
Minimum viable instrumentation
javascript
import { TraceRN } from "tracern-sdk";
TraceRN.init({
apiKey: "trn_live_xxxxxxxx",
environment: __DEV__ ? "dev" : "production",
release: "1.4.2",
enableAutoErrorCapture: true,
enableAutoBreadcrumbs: true,
enableSessionHeartbeat: true,
slowNetworkThresholdMs: 3000,
});
TraceRN.setUser(user.id);
TraceRN.trackScreen("Home");
// Milestone
TraceRN.log("checkout.started", { cartSize: cart.items.length, screen: "Checkout" });
// Failed outcome (no throw required)
TraceRN.error(new Error("payment.failed"), {
event: "payment.failed",
orderId,
reason: "card_declined",
});Checklist
- Init with
release+environment setUserafter logintrackScreenon every navigation- One info log at the start of each critical flow
- One error log for each failed user-visible outcome
- Alerts on
errorspikes for those event names — see alerts
Next: Checkout failed playbook
Last updated · TraceRN docs