log
The scloud log command provides a way to retrieve logs for your live service.
Running the base command below fetches the most recent logs:
scloud log
To retrieve logs within specific time ranges, the --until and --since options can be used. Both options accept either ISO date strings (e.g., "2024-01-15T10:30:00Z") or duration strings (e.g., "5m", "3h", "1d"). See some examples below:
# Using ISO date strings
scloud log --until=2024-12-01T00:00:00Z --since=2024-11-01T00:00:00Z
scloud log --since=2024-11-01T00:00:00Z
# Using duration strings
scloud log --since=5m
scloud log --since=1h --until=30m
# Mixing ISO dates and durations
scloud log --since=2024-11-01T00:00:00Z --until=10m
The --until option can also be passed as the first positional argument:
scloud log 10m
scloud log 3h
scloud log 14d
To tail the logs (i.e. get streaming real-time updates), add the --tail flag:
scloud log --tail
Usage
Fetch Serverpod Cloud logs.
Usage: scloud log [arguments]
-h, --help Print this usage information.
-p, --project (mandatory) The ID of the project.
Can be omitted for existing
projects that are linked. See
`scloud project link --help`.
--limit=<integer> The maximum number of log records
to fetch.
(defaults to "50")
-u, --[no-]utc Display timestamps in UTC timezone
instead of local.
--until=<YYYY-MM-DDtHH:MM:SSz or duration[us|ms|s|m|h|d]> Fetch records from before this
timestamp. Accepts ISO date (e.g.
"2024-01-15T10:30:00Z") or relative
from now (e.g. "5m", "3h", "1d").
Can also be specified as the first
argument.
--since=<YYYY-MM-DDtHH:MM:SSz or duration[us|ms|s|m|h|d]> Fetch records from after this
timestamp. Accepts ISO date (e.g.
"2024-01-15T10:30:00Z") or relative
from now (e.g. "5m", "3h", "1d").
--tail Tail the log and get real time
updates.
Run "scloud help" to see global options.
Examples
View the most recent logs (default: last 10 minutes).
$ scloud log
View logs from the last hour using duration.
$ scloud log 1h
$ scloud log --since 1h
View logs since a specific time using ISO date format:
$ scloud log --since 2025-01-15T14:00:00Z
$ scloud log --since "2025-01-15 14:00"
$ scloud log --since 2025-01-15
View logs in a time range using durations:
$ scloud log --since 1h --until 5m
View logs in a time range using ISO dates:
$ scloud log --since 2025-01-15 --until 2025-01-16
Mix ISO dates and durations:
$ scloud log --since 2025-01-15T14:00:00Z --until 30m
Stream logs in real-time.
$ scloud log --tail
View logs with UTC timestamps and a custom limit.
$ scloud log --utc --limit 100
See the full documentation at: https://docs.serverpod.cloud/references/cli/commands/log