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
- Navigate to your container
- Click the Logs tab
- 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
| Level | Description | Color |
|---|---|---|
| ERROR | Errors requiring attention | Red |
| WARN | Potential issues | Yellow |
| INFO | Normal operations | Blue |
| DEBUG | Detailed debugging | Gray |
Filtering by Level
- Click the Level filter
- Select levels to show:
- ERROR only
- ERROR + WARN
- All levels
Searching Logs
Basic Search
Type in the search box:
user login
Finds logs containing "user" AND "login".
Phrase Search
Use quotes for exact phrases:
"connection refused"
Field Search
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
Regex Search
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
- Click the time selector
- Enter specific date/time
- 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
- Open the Logs tab on any resource (container, database, job, etc.) or the Monitoring Center
- Toggle Live mode on
- Log lines appear in real-time as they are emitted
- 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:
| Filter | Description |
|---|---|
| Project | Scope to a single project, or stream across all projects in the organization |
| Workload type | container, job, cronjob, postgres, mariadb, valkey, opensearch, kafka, keycloak, wordpress, supabase, nats, custom (shown when the selected project contains that resource type) |
| Workload name | Filter to a specific resource |
| Instance | Filter to a specific pod instance |
| Level | debug, info, warning, error |
| Stream | stdout or stderr |
| Query | Free-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-rotatingevent 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-refusedevent is sent and the stream closes. - Dropped lines: when the log volume exceeds what the stream can deliver, the
droppedcounter 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:
- Apply the desired filters (project, workload, level, stream, time range, keyword)
- Click the Download .txt button in the Log Explorer toolbar
- The browser downloads a
.txtfile 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:
| Plan | Retention |
|---|---|
| Basic | 7 days |
| Starter | 30 days |
| Business | 90 days |
| Custom | Up 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
| Use | Level |
|---|---|
| Errors needing action | ERROR |
| Potential problems | WARN |
| Normal operations | INFO |
| Development details | DEBUG |
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
| Level | Content |
|---|---|
| ERROR | Errors and crashes |
| WARNING | Potential issues |
| STATEMENT | Slow queries |
| CONNECTION | Session 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
- Verify container is running
- Check your app outputs to stdout/stderr
- Wait a few seconds for collection
- Refresh the page
Missing Logs
- Check retention period
- Verify time range selection
- Check log level filters
Log Parsing Issues
If JSON logs aren't parsed:
- Verify valid JSON format
- Check for encoding issues
- 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:
- Reduce time range
- Add filters
- Pause live mode