Logs & Debugging
Access real-time application logs, build logs, and deployment logs to debug issues quickly. Search, filter, and stream logs directly from the dashboard or via API.
Types of Logs
Temps provides several types of logs to help you understand what's happening with your application:
Application Logs
- Runtime logs from your running containers
- Standard output (stdout) and error output (stderr)
- Real-time streaming available
- Searchable and filterable
Build Logs
- Output from build processes
- Docker build logs
- Dependency installation logs
- Build errors and warnings
Deployment Logs
- Deployment workflow execution
- Step-by-step deployment progress
- Configuration and setup logs
- Success/failure messages
Audit Logs
- System events and user actions
- Security-relevant operations
- Configuration changes
- Access attempts
Accessing Logs
Via Dashboard
Application Logs:
- Navigate to Projects → Select your project
- Choose an Environment
- Click on a Container
- Open the Logs tab
- View real-time logs or search historical logs
Build Logs:
- Go to Projects → Select your project
- Open Deployments
- Click on a deployment
- View build logs in the deployment details
Deployment Logs:
- Navigate to Deployments
- Select a deployment
- View step-by-step deployment logs
- See which steps succeeded or failed
Via CLI
# View application logs
temps logs my-project --environment production --tail 100
# Follow logs in real-time
temps logs my-project --environment production --follow
# View build logs for a deployment
temps deployment logs my-project --deployment 123
# Filter logs by level
temps logs my-project --level error
Via API
# Get container logs
curl -H "Authorization: Bearer YOUR_TOKEN" \
"https://your-temps-instance.com/api/projects/{project_id}/environments/{environment_id}/containers/{container_id}/logs?tail=100"
# Stream logs (Server-Sent Events)
curl -H "Authorization: Bearer YOUR_TOKEN" \
"https://your-temps-instance.com/api/projects/{project_id}/environments/{environment_id}/containers/{container_id}/logs/stream"
# Get deployment logs
curl -H "Authorization: Bearer YOUR_TOKEN" \
"https://your-temps-instance.com/api/projects/{project_id}/deployments/{deployment_id}/logs"
Log Levels
Temps supports structured logging with different log levels:
- Name
Success- Description
Successful operations, completions, and positive outcomes. Look for ✅ emoji indicators.
- Name
Info- Description
General informational messages about application flow and state.
- Name
Warning- Description
Warnings about potential issues that don't prevent operation.
- Name
Error- Description
Error messages indicating failures or problems. Look for ❌ emoji indicators.
Searching and Filtering Logs
Search by Text
Use the search box in the logs viewer to find specific messages:
- Exact match:
"error connecting to database" - Case-insensitive:
ERRORmatcheserror,Error,ERROR - Partial match:
databasefinds all lines containing "database"
Filter by Log Level
Filter logs to show only specific levels:
- Click the Filter button in the logs viewer
- Select log levels (Success, Info, Warning, Error)
- View filtered results
Filter by Time Range
View logs from specific time periods:
- Use the Time Range selector
- Choose:
- Last hour
- Last 24 hours
- Last 7 days
- Custom range
- Logs update to show only the selected period
Filter by Deployment
View logs for a specific deployment:
- Go to Deployments
- Select a deployment
- View logs specific to that deployment
- Compare logs across different deployments
Real-Time Log Streaming
Stream logs in real-time to see events as they happen:
In Dashboard
- Open the Logs tab for a container
- Click Follow or Stream button
- Logs update automatically as new entries arrive
- Scroll to bottom to see latest logs
Via API
// JavaScript example - Server-Sent Events
const eventSource = new EventSource(
`/api/projects/${projectId}/environments/${environmentId}/containers/${containerId}/logs/stream`,
{
headers: {
'Authorization': `Bearer ${token}`
}
}
);
eventSource.onmessage = (event) => {
const logEntry = JSON.parse(event.data);
console.log(logEntry.message);
};
Structured Logging Best Practices
To get the most out of Temps logging, use structured logging in your application:
JSON Logging
// Node.js example
console.log(JSON.stringify({
level: 'info',
message: 'User logged in',
userId: 123,
timestamp: new Date().toISOString()
}));
# Python example
import json
import logging
logging.info(json.dumps({
'level': 'info',
'message': 'User logged in',
'user_id': 123,
'timestamp': datetime.now().isoformat()
}))
Log Levels
Use appropriate log levels:
// Debug - detailed information for debugging
console.debug('Processing request', { requestId, userId });
// Info - general informational messages
console.info('User logged in', { userId });
// Warning - potential issues
console.warn('Rate limit approaching', { userId, requests: 95 });
// Error - errors that need attention
console.error('Database connection failed', { error: err.message });
Include Context
Always include relevant context in logs:
// Good: Includes context
console.log(JSON.stringify({
level: 'error',
message: 'Payment processing failed',
userId: 123,
orderId: 456,
amount: 99.99,
error: error.message,
timestamp: new Date().toISOString()
}));
// Bad: Missing context
console.error('Payment failed');
Log Retention
- Name
Application Logs- Description
- Retention: 7 days by default
- Configurable: Up to 90 days
- Storage: Compressed and stored efficiently
- Access: Available via dashboard and API
- Name
Build Logs- Description
- Retention: 30 days
- Storage: Associated with deployments
- Access: Available for successful and failed builds
- Name
Deployment Logs- Description
- Retention: 90 days
- Storage: Full deployment history
- Access: Available for all deployment attempts
- Name
Audit Logs- Description
- Retention: 1 year (configurable)
- Storage: Securely stored for compliance
- Access: Admin access only
Downloading Logs
Download logs for offline analysis or archival:
Via Dashboard
- Open the Logs tab
- Apply any filters you need
- Click Download button
- Choose format (text or JSON)
- Save to your computer
Via API
# Download container logs
curl -H "Authorization: Bearer YOUR_TOKEN" \
"https://your-temps-instance.com/api/projects/{project_id}/environments/{environment_id}/containers/{container_id}/logs/download" \
-o logs.txt
# Download deployment logs
curl -H "Authorization: Bearer YOUR_TOKEN" \
"https://your-temps-instance.com/api/projects/{project_id}/deployments/{deployment_id}/logs/download" \
-o deployment-logs.txt
Troubleshooting with Logs
- Name
Application Crashes- Description
Symptoms: Container restarts, 502 errors
What to check:
- Look for error logs before restart
- Check for out-of-memory errors
- Review exception stack traces
- Check for unhandled promise rejections (Node.js)
Example log pattern:
ERROR: Unhandled exception TypeError: Cannot read property 'id' of undefined at /app/src/routes/users.js:45:12
- Name
Slow Performance- Description
Symptoms: High response times, timeouts
What to check:
- Search for "slow" or "timeout" in logs
- Look for database query logs
- Check for external API call delays
- Review request processing times
Example log pattern:
WARN: Database query took 5.2s INFO: External API call completed in 3.1s
- Name
Deployment Failures- Description
Symptoms: Deployments failing to complete
What to check:
- Review build logs for compilation errors
- Check for missing dependencies
- Look for configuration errors
- Review deployment step logs
Example log pattern:
ERROR: Build failed npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! build: `next build`
- Name
Connection Issues- Description
Symptoms: Database or external service connection errors
What to check:
- Search for "connection" or "connect" errors
- Look for timeout messages
- Check for authentication failures
- Review network-related errors
Example log pattern:
ERROR: Failed to connect to database Error: connect ECONNREFUSED 127.0.0.1:5432
Next Steps
- Monitor Application Metrics to correlate logs with performance
- Set Up Error Tracking to automatically capture errors
- Configure Log Retention to customize how long logs are kept
- Integrate with External Tools to send logs to external log management services