Koo Docs
View as Markdown

Logs

Every web service on Koo produces a live log stream you can read in the console. Koo captures everything your service writes to standard output and standard error — no agent or logging library required.

View a service's logs

  1. Open the environment canvas and click the service's node — its drawer opens.
  2. Open the Logs tab.
  3. Pick a time window. The stream starts paused; switch the mode to Live to follow new lines as your service writes them.
  4. Type in the search box to filter the visible lines as you type. Switch the mode to Query to search an absolute time window instead — pick the range and press Run.

When a service is failing at runtime, the error shown on it carries a View logs button. It opens the Logs tab windowed around the moment of the failure, so the lines you need are already on screen.

Databases have no Logs tab

A Postgres or Redis database has no Logs tab — it doesn't expose a log stream. A database's operational logs are Koo's to watch, not yours.

Your view into a database is its metrics and its status.

The account-wide stream

The account pages have a Logs page of their own: one combined stream across every service in the account, each line attributed to the service that wrote it. It reads the same three ways as the per-service tab:

  • Live — the tail follows new lines as they arrive; the search box filters what's on screen as you type.
  • Paused — the tail stops fetching; the rows stay put while you read.
  • Query — pick a time range and press Run; your search text is applied across the whole window.

Filter chips scope the stream to a single project, environment, or service. In between the two scopes, each environment's rail also has a Logs page — a combined recent window across that environment's services, merged by timestamp, with a service filter and search.

The per-service and account-wide streams are available programmatically through the observability API, authenticated with an API token; the environment's Logs page is a console view built on the per-service stream.

Retention

How far back you can read depends on your plan — each plan's log retention window is listed in usage & limits. Requests beyond your window are clamped to it.

Logs older than your plan's retention window are gone — there is no archive to restore from. If you need logs long-term, forward them to your own log store from inside your service.

Logs from the CLI

The Koo CLI prints the linked service's recent logs:

bash
koo logs

Add -f to follow the stream, --since to set the window (for example --since 1h), and --filter to keep only lines containing a string:

bash
koo logs -f --since 30m --filter "error"

Build logs are separate

Everything on this page describes runtime logs: output from your running service. Build logs are the output of turning your source into an image — they land on the deployment that ran the build, in the service's Deployments tab. See builds.

Deploys that ship a prebuilt image have no build step and no build logs.

Tips

  • Write to stdout and stderr, not files. Koo only captures the standard streams, and a service's filesystem does not survive a new deployment.
  • Log structured JSON lines. One JSON object per line is easy to scan in the live tail and easy to parse if you forward logs elsewhere.
  • Include a request ID in every line. Emitting the same ID across all lines for one request lets you follow it through interleaved output.
  • Never log secrets. Keep sensitive variable values, API tokens (kc_…), and user data out of log lines — logs are visible to every member of your account.