Skip to main content
View and stream logs from all replicas of one or more services across your cluster. Logs from different machines and containers are merged and displayed in chronological order.

Usage

uc logs [FLAGS] [SERVICE...]
Alias: uc log

Arguments

SERVICE
string[]
Names of services to view logs from. If not specified, shows logs from all services defined in the Compose file.

Flags

--file
string[]
One or more Compose files to load service names from when no services are specified. Default: compose.yaml
-f, --follow
Continually stream new logs in real-time.
-m, --machine
string[]
Filter logs by machine name or ID. Can be specified multiple times or as a comma-separated list.
--since
string
Show logs generated on or after the given timestamp. Accepts relative duration, RFC 3339 date, or Unix timestamp.Examples:
  • --since 2m30s - 2 minutes 30 seconds ago
  • --since 1h - 1 hour ago
  • --since 2025-11-24 - RFC 3339 date (midnight local time)
  • --since 2024-05-14T22:50:00 - RFC 3339 date/time (local)
  • --since 2024-01-31T10:30:00Z - RFC 3339 date/time (UTC)
  • --since 1763953966 - Unix timestamp
-n, --tail
string
default:"100"
Show the most recent logs and limit the number of lines shown per replica. Use all to show all logs.
--until
string
Show logs generated before the given timestamp. Accepts the same formats as --since.
--utc
Print timestamps in UTC instead of local timezone.

Examples

View recent logs for a service

uc logs web

Stream logs in real-time

uc logs -f web

View logs from multiple services

uc logs web api db

View logs from all services in Compose file

uc logs

Show last 20 lines per replica

uc logs -n 20 web

Show all logs without line limit

uc logs -n all web

View logs from a specific time range

uc logs --since 3h --until 1h30m web
Show logs from 3 hours ago until 1 hour 30 minutes ago.

View logs from specific machines

uc logs -m machine1,machine2 web api

View logs with UTC timestamps

uc logs --utc web

Log Format

Each log line shows:
[timestamp] [machine] [service[container]] [message]
Example:
Jan 15 14:23:45.123  vps1      web[a1b2c]  GET /api/users 200
Jan 15 14:23:45.456  vps2      web[d3e4f]  GET /api/posts 200
Jan 15 14:23:46.789  vps1      api[g5h6i]  Processing request

Color Coding

  • Single service: Machine names are colored to differentiate machines
  • Multiple services: Service names are colored to differentiate services
  • Timestamps: Dimmed for readability
  • Container IDs: Dimmed, showing first 5 characters

Time Filters

Relative Durations

View logs from the last hour:
uc logs --since 1h web
View logs from 30 minutes to 10 minutes ago:
uc logs --since 30m --until 10m web

Absolute Timestamps

View logs from a specific date:
uc logs --since 2024-11-24 web
View logs from a specific time:
uc logs --since "2024-11-24T15:30:00" web

Unix Timestamps

uc logs --since 1700000000 web

Following Logs

Stream logs in real-time from all replicas:
uc logs -f web
This is useful for:
  • Monitoring deployments
  • Debugging issues in real-time
  • Watching application behavior
Press Ctrl+C to stop streaming.

Machine Filtering

View logs only from specific machines:
uc logs -m vps1 web
Multiple machines:
uc logs -m vps1,vps2 web api

Multiple Services

When viewing logs from multiple services, logs are merged and sorted by timestamp:
uc logs web api worker
Service names are color-coded to help distinguish between services.

Viewing All Services

View logs from all services in your Compose file:
uc logs
This loads service names from compose.yaml and shows logs from all of them.

Use Cases

Debugging Deployments

After deploying, watch logs to ensure everything starts correctly:
uc deploy -y && uc logs -f web

Troubleshooting Errors

View recent logs to find errors:
uc logs -n 200 web | grep ERROR

Monitoring Traffic

Stream logs to watch requests:
uc logs -f web | grep GET

Checking Specific Time Period

Investigate what happened during an incident:
uc logs --since "2024-11-24T15:00:00" --until "2024-11-24T16:00:00" web

Build docs developers (and LLMs) love