Skip to Content
UsageLogs

Logs

Beyond errors, your app emits a stream of structured logs — “user signed up”, “cache miss”, “payment gateway slow”. Rustrak stores these as standalone Logs, separate from Issues, so you can see what your app was doing without it having to crash first.

Logs use Sentry’s log item type, so any Sentry SDK with logging enabled sends them to Rustrak unchanged.

What’s a log?

A log is a single structured line with a severity level, a text body, and any attributes you attach:

Sentry.logger.info('User signed up', { userId: user.id, plan: 'pro', referrer: 'google', });

That one call produces a log with:

  • levelinfo
  • bodyUser signed up
  • attributesuserId, plan, referrer (each keeps its type: number, string, boolean…)
  • timestamp — when it happened
  • trace_id / span_id — if emitted inside an active span, so the log ties back to a request

Unlike errors, logs are not grouped. Each one is stored and shown as-is, newest first.

Where to find them

Open a project and click Logs in the sidebar. You get a table with:

ColumnWhat it shows
Leveltrace, debug, info, warn, error, fatal
MessageThe log body
TraceShort trace ID (if the log belongs to a trace)
TimeWhen the log was emitted

Click any row to expand it and see the full timestamp, trace_id, span_id, severity number, and the complete list of attributes with their types. Use the level buttons at the top to filter (e.g. only error and fatal).

Sending logs from your SDK

Logging is off by default in Sentry SDKs — enable it in Sentry.init, then call the logger.

Node.js / JavaScript

import * as Sentry from '@sentry/node'; Sentry.init({ dsn: 'http://<sentry_key>@localhost:8080/<project_id>', enableLogs: true, // required — opts into the log item type }); const { logger } = Sentry; logger.trace('Entering checkout state machine', { step: 1 }); logger.debug('Cache miss', { key: 'products:popular', hit: false }); logger.info('User signed up', { userId: 4172, plan: 'pro' }); logger.warn('Payment gateway slow', { gateway: 'stripe', latencyMs: 1830 }); logger.error('Failed to charge card', { code: 'insufficient_funds' }); logger.fatal('DB connection pool exhausted', { waiting: 57 });

The SDK batches logs and flushes them periodically (and on Sentry.flush() before exit). They appear in the Logs table within a few seconds.

Tip: Requires a Sentry SDK version with the logs feature (@sentry/node v9.17+ / v10+). Older SDKs simply won’t send the log item type.

Correlating logs with traces

If you emit a log inside an active span, the SDK attaches the trace_id and span_id automatically — so you can filter every log from a single request:

await Sentry.startSpan( { name: 'POST /api/checkout', op: 'http.server' }, async () => { logger.info('Order placed', { orderId: 9182 }); // ...this log carries the span's trace_id + span_id }, );

Levels

Rustrak maps each level to an OTel severity number, which is what it sorts and filters on:

LevelSeverityUse it for
trace1Very fine-grained step-by-step detail
debug5Diagnostic info while developing
info9Normal, expected events
warn13Something unusual but recoverable
error17A failure that needs attention
fatal21The app can’t continue

API access

Logs are read-only over the API. List them with a bearer token:

# Newest logs for a project curl -H "Authorization: Bearer YOUR_TOKEN" \ "http://localhost:8080/api/projects/1/logs" # Filter by level, page through results curl -H "Authorization: Bearer YOUR_TOKEN" \ "http://localhost:8080/api/projects/1/logs?level=error&page=2&per_page=50" # All logs from one trace curl -H "Authorization: Bearer YOUR_TOKEN" \ "http://localhost:8080/api/projects/1/logs?trace_id=abc123..."

Each log in the response keeps the attributes exactly as the SDK sent them (the OTel typed map), with denormalized fields surfaced for filtering:

{ "items": [ { "id": "0c9b…", "level": "info", "severity_number": 9, "body": "User signed up", "trace_id": "abc123…", "span_id": "def456…", "attributes": { "userId": { "value": 4172, "type": "integer" }, "plan": { "value": "pro", "type": "string" } }, "timestamp": "2026-06-26T10:30:00Z", "ingested_at": "2026-06-26T10:30:01Z" } ], "total_count": 1240, "page": 1, "per_page": 50, "total_pages": 25 }

You can also browse logs from an AI assistant via the MCP server (list_logs).

Managing storage

Logs count toward your instance storage and are included in retention cleanup. An admin can delete old logs from Settings → Storage along with events, transactions, and spans — see Storage.

Behavior reference

SituationResult
SDK without enableLogs: trueNo logs sent — the Logs table stays empty
Log emitted outside any spanStored with trace_id / span_id empty
Log emitted inside a spanCarries the span’s trace_id + span_id
Unknown / custom levelStored as-is with severity_number null
Storage cleanup older than N daysOld logs are removed with the rest of the data
Last updated on