Skip to content

Logging best practices

  • Message is for humans, metadata is for filters. Put ids and player references in metadata, not in the message text — body search only scans the message.
  • One resource per system (shop, inventory, anticheat). Filtering by resource is exact and cheap.
  • Levels mean something: error = action needed, warn = degraded, info = normal events, debug = noisy detail, fatal = server-stopping.
  • Always pass playerSource when a player caused the event — you get license/discord/steam filtering for free.
  • Don’t log in a hot loop. Batch (the SDK does); the API cap is 1000 entries per call.
  • Set your own traceId when one action spans resources — it makes retries idempotent and the trace view useful.