Skip to main content

Logs

Real-time log streaming and powerful search for debugging.

Overview​

SailOps captures and stores logs from all your resources:

  • Container logs - stdout and stderr output
  • Database logs - PostgreSQL server logs
  • Gateway logs - Access and error logs
  • System logs - Platform events

Viewing Logs​

Container Logs​

  1. Navigate to your container
  2. Click the Logs tab
  3. View real-time log stream

Features​

  • Live streaming - Logs appear in real-time
  • Pause/Resume - Stop stream to examine logs
  • Search - Find specific entries
  • Filter - By level, time, or content
  • Download .txt - Export matching logs as a plain-text file

Log Format​

Standard Log Entry​

2024-01-15T10:30:45.123Z INFO  [app] User logged in successfully
2024-01-15T10:30:45.456Z ERROR [db] Connection timeout after 5000ms
2024-01-15T10:30:46.789Z DEBUG [api] Processing request: POST /users

Structured Logs (JSON)​

{
"timestamp": "2024-01-15T10:30:45.123Z",
"level": "INFO",
"message": "User logged in successfully",
"user_id": "usr_123abc",
"request_id": "req_456def",
"duration_ms": 45
}

SailOps parses JSON logs and makes fields searchable.

Log Levels​

LevelDescriptionColor
ERRORErrors requiring attentionRed
WARNPotential issuesYellow
INFONormal operationsBlue
DEBUGDetailed debuggingGray

Filtering by Level​

  1. Click the Level filter
  2. Select levels to show:
    • ERROR only
    • ERROR + WARN
    • All levels

Searching Logs​

Type in the search box:

user login

Finds logs containing "user" AND "login".

Use quotes for exact phrases:

"connection refused"

Search specific fields (JSON logs):

user_id:usr_123abc
level:ERROR
status_code:500

Combining Searches​

Use AND, OR, NOT:

level:ERROR AND service:api
"timeout" OR "connection refused"
NOT level:DEBUG

Use regex patterns:

/user_\d+/
/error.*timeout/i

Time Navigation​

Time Range Selection​

Choose preset ranges:

  • Last 15 minutes
  • Last 1 hour
  • Last 6 hours
  • Last 24 hours
  • Last 7 days
  • Custom range

Jump to Time​

  1. Click the time selector
  2. Enter specific date/time
  3. Logs jump to that point

Live Mode​

Enable live mode for real-time logs:

  • New logs appear automatically
  • Auto-scrolls to latest
  • Click to pause

Live Log Streaming​

Overview​

SailOps supports true live log streaming via Server-Sent Events (SSE). Unlike polling, live streaming delivers log lines as they are produced with sub-second latency.

When live mode is active, new lines appear continuously in the log viewer. The stream automatically reconnects if the connection drops, and a heartbeat ensures stale connections are detected.

How it works​

  1. Open the Logs tab on any resource (container, database, job, etc.) or the Monitoring Center
  2. Toggle Live mode on
  3. Log lines appear in real-time as they are emitted
  4. Click Pause to freeze the display — lines are buffered and appear when you resume

Filters​

Live streaming supports the same filters as historical log search:

FilterDescription
ProjectScope to a single project, or stream across all projects in the organization
Workload typecontainer, job, cronjob, postgres, mariadb, valkey, opensearch, kafka, keycloak, wordpress, supabase, nats, custom (shown when the selected project contains that resource type)
Workload nameFilter to a specific resource
InstanceFilter to a specific pod instance
Leveldebug, info, warning, error
Streamstdout or stderr
QueryFree-text search on the log message

Changing a filter restarts the stream with the new criteria.

Stream lifecycle​

  • Maximum duration: streams are automatically rotated after 2 hours. The client receives a stream-rotating event shortly before expiry and seamlessly opens a new stream.
  • Authorization: your session is periodically re-verified. If your access is revoked mid-stream, a stream-refused event is sent and the stream closes.
  • Dropped lines: when the log volume exceeds what the stream can deliver, the dropped counter in each event payload tells you how many lines were discarded over the window.

Pause and Resume​

  • Click Pause to stop auto-scroll
  • Review logs without losing new entries
  • Click Resume to continue

Log Context​

Request Tracing​

If your app includes trace IDs:

{
"message": "Request processed",
"trace_id": "abc123",
"span_id": "def456"
}

Click the trace ID to see all related logs.

Container Instance​

When running multiple replicas:

[instance-1] Processing request...
[instance-2] Processing request...

Filter by instance to isolate logs.

Downloading Logs​

Download the logs that match your current filters as a plain-text file:

  1. Apply the desired filters (project, workload, level, stream, time range, keyword)
  2. Click the Download .txt button in the Log Explorer toolbar
  3. The browser downloads a .txt file containing up to 100 000 matching log lines

The exported file preserves the timestamp, level, project, instance, stream, image, and message for each entry.

Log Retention​

Log retention depends on your support plan:

PlanRetention
Basic7 days
Starter30 days
Business90 days
CustomUp to 730 days

Logs older than the retention period are automatically deleted. CUSTOM plan organizations may have negotiated retention periods that differ from the defaults above — your effective retention is visible in the organization metadata and reflected in the log explorer time range.

Best Practices​

1. Use Structured Logging​

// Bad - hard to search
console.log('User ' + userId + ' logged in from ' + ip);

// Good - structured and searchable
console.log(JSON.stringify({
event: 'user_login',
user_id: userId,
ip_address: ip,
timestamp: new Date().toISOString()
}));

2. Include Context​

Add useful context to logs:

logger.info('Order created', {
order_id: order.id,
user_id: user.id,
total: order.total,
items: order.items.length
});

3. Use Appropriate Levels​

UseLevel
Errors needing actionERROR
Potential problemsWARN
Normal operationsINFO
Development detailsDEBUG

4. Add Request IDs​

Track requests across services:

app.use((req, res, next) => {
req.requestId = uuid();
res.setHeader('X-Request-Id', req.requestId);
next();
});

// Include in all logs
logger.info('Processing request', { request_id: req.requestId });

5. Don't Log Sensitive Data​

Never log:

  • Passwords
  • API keys
  • Credit card numbers
  • Personal data (GDPR)
// Bad
logger.info('User login', { password: user.password });

// Good
logger.info('User login', { user_id: user.id });

Database Logs​

PostgreSQL Logs​

Database logs include:

  • Statements - Slow queries (> 1s)
  • Connections - Connect/disconnect events
  • Errors - Database errors
  • Warnings - Performance warnings

Log Levels​

LevelContent
ERRORErrors and crashes
WARNINGPotential issues
STATEMENTSlow queries
CONNECTIONSession activity

Slow Query Log​

2024-01-15 10:30:45.123 UTC [1234] LOG:  duration: 5023.456 ms  statement: SELECT * FROM large_table

Gateway Logs​

Access Logs​

2024-01-15T10:30:45.123Z 200 GET /api/users 45ms 192.168.1.1 "Mozilla/5.0..."

Fields:

  • Timestamp
  • Status code
  • Method
  • Path
  • Duration
  • Client IP
  • User agent

Error Logs​

2024-01-15T10:30:45.123Z 502 POST /api/orders 5023ms - upstream timeout

Troubleshooting​

Logs Not Appearing​

  1. Verify container is running
  2. Check your app outputs to stdout/stderr
  3. Wait a few seconds for collection
  4. Refresh the page

Missing Logs​

  1. Check retention period
  2. Verify time range selection
  3. Check log level filters

Log Parsing Issues​

If JSON logs aren't parsed:

  1. Verify valid JSON format
  2. Check for encoding issues
  3. Ensure one JSON object per line

Truncated Results in Grafana​

When a Grafana log query hits its internal scan budget, the panel header shows a warning: "Results are partial: this query hit its scan budget." This means the time window or filter matched more data than the query is allowed to read in a single pass. To see the full result set, narrow the time range or add a more selective filter.

Performance Issues​

If log viewer is slow:

  1. Reduce time range
  2. Add filters
  3. Pause live mode