Key idea
Narrow first, then read. Pick a time range, search, filter by level or spherelet: a thousand lines become the ten you need. To watch a problem happen, follow the log live.
In the console
On the service's Logs tab, Runtime view:
- Time range at the top. The bar chart under it counts lines over time; select a bar to zoom into that stretch.
- Search logs in this time range: text matched exactly as you type it, ignoring case, such as
failed, a request ID orrequest failed. Quote marks count as text, so"missing":"SIGNING_KEY"finds that field in a JSON line. - All, Error, Warn, Info, Debug filter by level. A
fatalline counts as Error. - The spherelet filter shows lines from chosen spherelets only.
- Live means new lines appear as they're written; select it to pause.
From the terminal
Don't run these yet: shop-api arrives in the next lab.
csph logs shop-api --search failed # search
csph logs shop-api --search '"missing":"SIGNING_KEY"' # a JSON field
csph logs shop-api --since 30m --timestamps # last 30 minutes, with times
csph logs shop-api --follow # stream live; Ctrl-C to stop
csph logs shop-api --kind deploy # the deploy log, newest first
--search matches the same way as the console; wrap text with spaces or double quotes in single quotes. --follow works for runtime logs only. --tail sets how many recent lines to fetch; 200 by default.
Cron job runs
A cron job has a Runs tab instead: one row per run, with its status (Running, Success or Failed) and start time. Select a run to read its log; filter by Failed to find the night it broke. No need to deploy one for this path.
Check yourself