ObservabilityPlaybook3 min readUpdated September 2026

What Should a Startup Log? A Practical Logging Plan

A startup should log events that help it answer three questions later: what happened, to whom, and why it failed. Log structured, consistent fields on requests, errors, background jobs and security-relevant actions, and never log secrets or unneeded personal data.

The rest is discipline about volume and retention. Logs are cheap to write and expensive to store and search, so a plan that decides up front what each log line is for saves money and speeds up incident response.

Vendors Covered in this Article

Disclosure: We may earn a commission if you buy through some links on this page. It doesn't change what we recommend.

What is worth logging?

Log at boundaries and at decisions. These categories cover most needs:

  • Requests: one line per inbound request with method, route template, status and duration.
  • Errors: every unhandled exception with a stack trace and the context needed to reproduce.
  • Background jobs: start, finish, failure and retry count for each job, with its identifier.
  • External calls: which third-party service was called, how long it took and whether it failed.
  • Security and audit events: sign-ins, failures, permission changes, data exports and administrative actions.
  • Business milestones: signup completed, payment succeeded, subscription changed. These help support and debugging.

Skip the play-by-play inside functions. If a line wouldn't help someone at 2 a.m., it's noise, and noise makes the useful lines harder to find.

How should you structure each log line?

Use structured logging, meaning one JSON object per line, rather than free text. That lets you filter by field instead of writing regular expressions. Standardize these fields across every service:

  • A timestamp in UTC and a severity level.
  • Service name, environment and deployed version.
  • A request or trace ID that follows the request across services.
  • A tenant or account ID, and a user ID that is an internal identifier, not an email.
  • The event name as a stable, searchable string, plus a short message.
  • Error type and message when relevant.

The request ID is the single most valuable field. With it, you can pull every line from one failing request across every service in a few seconds. Add it in middleware once, so nobody has to remember. If you version your API, include the version too; it pairs well with the versioning policy outline.

What must you never log?

Logs get copied to vendors, shared in chat and read by many people, so treat them as widely exposed. Never write:

  • Passwords, API keys, session tokens or authorization headers.
  • Full payment card numbers or bank details.
  • Full request and response bodies by default, which often contain personal data.
  • Personal data that isn't needed to debug, such as full names, addresses or health information.

Add a redaction layer in your logger that masks known sensitive keys, and write a test for it. Review what your framework logs by default, since some log query strings and headers. If a customer requests deletion of their data, logs are part of the picture, which is why minimizing personal data in logs saves you work later.

How do you choose levels, retention and cost controls?

Use levels consistently. ERROR means a person should look at this, WARN means something unexpected but handled, INFO covers normal milestones and DEBUG is off in production unless you're actively investigating. If everything is ERROR, nothing is.

Then tier your retention:

  1. Searchable, short-term: errors and warnings for a couple of weeks, where fast queries matter.
  2. Sampled: routine request lines, sampled or aggregated once you have volume.
  3. Archive: everything else in low-cost storage for as long as you need it, retrievable when required.
  4. Audit logs: kept separately, with retention set by your compliance obligations, and protected from edits.

Check current pricing for your logging vendor, because ingestion and indexing are often billed separately. Trimming an observability bill is a separate exercise from deciding what to log, so settle the plan first. The platform comparison covers vendor differences.

How do you know your logging is good enough?

Run a drill. Pick a recent bug or pretend one, and try to answer: which customer was affected, which request failed, what did each service do and what changed recently? If you can trace it in five minutes using only logs, the plan works. If you need to guess or add new log lines and redeploy, note exactly what was missing and add it.

Review the plan quarterly along with cost. Remove lines nobody has queried, add fields that keep being needed and confirm that redaction still holds after code changes.

Executive Capability Standard

What Good Looks Like

Every service emits structured logs with a shared set of fields and a request ID, sensitive data is redacted, and retention is tiered by purpose.

Building The Capability (5-Stage Skill Ladder)

1. Learn:Learn structured logging, log levels and the fields every line should carry.
2. Do Manually:Audit one service's logs for noise, missing request IDs and sensitive data, and fix the worst offenders.
3. Delegate:Assign a logging owner to maintain the field standard, redaction rules and retention policy.
4. Automate:Add logging middleware, automatic redaction and tests that fail when a secret pattern appears in output.
5. Buy:Adopt a managed log platform once self-hosted search and storage cost more time than they save.

How to Get Started

Disclosure: We may earn a commission if you buy through some links on this page. It doesn't change what we recommend.

Datadog

Fits when you want logs, metrics and traces searchable together, provided you set retention and exclusion rules early to control cost.

Visit Datadog→

Frequently Asked Questions

What should a startup log first?

Start with request lines, unhandled errors, background job outcomes and security events, all with a request ID. Those cover most debugging needs. Add business milestones next and expand only when a real question can't be answered.

Should we log in JSON?

Yes, in most cases. Structured JSON lines let you filter and aggregate by field without fragile text parsing. Keep field names consistent across services, and include a request or trace ID in every line.

How long should we keep logs?

It depends on use. Keep searchable operational logs for a short window, archive cheaper copies longer, and set audit log retention by your compliance and contract needs. Check with your attorney if regulations apply.

Is it okay to log user emails?

Avoid it when an internal user ID would do. Emails are personal data, and logs spread widely. Log stable internal identifiers and look up the person in your database when needed.

About the numbers

This guide doesn't quote a sourced benchmark. Figures in it are estimates or general guidance, so check them against your own numbers.

Related Guides