Logs

Access build and runtime logs for every service. Stream logs in real-time, filter by severity, search for specific patterns, and download logs for offline analysis.

Build Logs vs. Runtime Logs

sh0 captures two distinct types of logs for each service. Understanding the difference helps you find the information you need quickly.

Build Logs

Build logs capture everything that happens during the image build process. This includes Dockerfile layer execution, dependency installation, compilation output, and build errors.

Build logs are accessible from the Deployments tab. Each deployment has its own build log.

Build log viewer -- showing Docker build output with layer caching indicators, step numbers, and timestamps

Common things to look for in build logs:

  • Dependency errors -- Failed npm install, pip install, or package resolution issues.
  • Compilation errors -- TypeScript, Rust, Go, or other compile-time failures.
  • Cache hits -- Layers marked as "CACHED" that speed up the build.
  • Image size -- The final image size is shown at the end of the build.
Example build log output
Step 1/8 : FROM node:20-alpine
 ---> 2d8f48ba52c1
Step 2/8 : WORKDIR /app
 ---> Using cache
 ---> 8a3d2e1f5b7c
Step 3/8 : COPY package*.json ./
 ---> Using cache
 ---> 4f2a1b3c8d9e
Step 4/8 : RUN npm ci --production
 ---> Running in 7e6d5c4b3a2f
added 847 packages in 12.3s
Step 5/8 : COPY . .
 ---> 1a2b3c4d5e6f
Step 6/8 : RUN npm run build
 ---> Running in 9f8e7d6c5b4a
Build completed successfully
Step 7/8 : EXPOSE 3000
Step 8/8 : CMD ["node", "dist/server.js"]
Successfully built a1b2c3d4e5f6

Runtime Logs

Runtime logs capture the output of your running application -- everything your process writes to stdout and stderr. This includes HTTP request logs, application errors, debug messages, and any other output.

Access runtime logs from the Logs tab on the service detail page.

Runtime log viewer -- showing timestamped log entries with color-coded severity levels (info, warn, error)

Real-Time Log Streaming

The log viewer streams logs in real-time using WebSocket connections. New log entries appear instantly at the bottom of the viewer as they are produced by your application.

  • Auto-scroll -- The viewer auto-scrolls to show the latest entries. Scroll up to pause auto-scrolling and inspect older entries.
  • Pause / Resume -- Click the Pause button to stop the stream temporarily. Logs are buffered and appear when you resume.
  • Timestamp format -- Each line is prefixed with a timestamp. Click the timestamp format toggle to switch between relative ("2s ago") and absolute ("2026-03-21 14:30:05") formats.
Log streaming controls -- showing pause/resume button, auto-scroll indicator, and timestamp format toggle
Note
If your service has multiple replicas, the log viewer merges logs from all containers into a single stream. Each entry is tagged with the container ID so you can distinguish between replicas.

Filtering Logs

Filter logs to focus on what matters. sh0 provides several filtering options:

  • Time range -- View logs from the last 15 minutes, 1 hour, 6 hours, 24 hours, or a custom date range.
  • Container -- When a service has multiple replicas, filter to a specific container instance.
  • Stream -- Show only stdout, only stderr, or both.
  • Severity -- If your application uses structured logging, filter by severity level (debug, info, warn, error).
Log filter bar -- showing time range dropdown, container selector, stream toggle (stdout/stderr), and severity dropdown
Tip
Filtering by stderr is a quick way to see only error output. Most applications write normal output to stdout and errors to stderr.

Searching Logs

Use the search bar to find specific entries in the log stream. Search supports plain text matching and basic regular expressions.

  1. Click the search icon or press Ctrl + F (or Cmd + F on macOS).
  2. Type your search query.
  3. Matching entries are highlighted in the log viewer.
  4. Use the up/down arrows in the search bar to jump between matches.
Search examples
# Find all error messages
ERROR

# Find a specific user ID
user_id=12345

# Find requests to a specific endpoint
POST /api/users

# Find slow requests (regex)
took [0-9]{4,}ms

Downloading Logs

Download logs for offline analysis, archival, or sharing with your team. Click the Download button in the log viewer to export the currently visible logs.

  • Plain text (.log) -- Raw log output with timestamps, ready for grep, awk, or any text processing tool.
  • JSON (.json) -- Structured format with timestamp, container ID, stream (stdout/stderr), and message fields.
JSON log export format
{
  "timestamp": "2026-03-21T14:30:05.123Z",
  "container": "my-api-1",
  "stream": "stdout",
  "message": "GET /health 200 2ms"
}
Note
Downloaded logs respect the active filters and time range. To download all available logs, clear all filters and set the time range to the maximum before exporting.

Log Retention

sh0 retains logs based on your configuration. Default retention settings balance storage usage with debugging needs:

Log TypeDefault RetentionConfigurable
Build logsLast 20 buildsYes
Runtime logs7 daysYes (1-90 days)
Cron job logsLast 100 executionsYes

To adjust retention settings, navigate to Settings → Logs and update the retention values. Reducing retention saves disk space on the server.

Tip
For applications that produce high log volume, consider reducing retention to 3 days and using the download feature to archive important logs. You can also configure your application to reduce log verbosity in production.
Log retention settings -- showing retention period inputs for build logs, runtime logs, and cron job logs