Logs
View and manage application logs.
Access application logs and activity history for debugging and auditing.
Log Types
| Type | Source | Purpose |
|---|---|---|
| PM2 Logs | Application | Debug application issues |
| Activity Log | Supascale | Audit user actions |
| Container Logs | Docker | Debug project issues |
PM2 Application Logs
Via Web UI
Navigate to Logs to view PM2 application logs.
Via API
curl "https://supascale.example.com/api/v1/system/logs?lines=100" \ -H "X-API-Key: your-api-key"
Response:
{
"logs": [
{
"timestamp": "2026-01-19T12:00:00Z",
"type": "out",
"process": "supascale-web",
"message": "Server started on port 3000"
},
{
"timestamp": "2026-01-19T12:00:05Z",
"type": "out",
"process": "supascale-web",
"message": "Database connected"
}
],
"processes": ["supascale-web"]
}
Filter Options
| Parameter | Description | Example |
|---|---|---|
lines | Number of lines | 100 |
type | Log type | out, err, all |
process | Process name | supascale-web |
# Error logs only curl "https://supascale.example.com/api/v1/system/logs?type=err&lines=50" # Specific process curl "https://supascale.example.com/api/v1/system/logs?process=supascale-web"
Activity Log
Track all user and system actions.
Via Web UI
Navigate to Settings > Activity History.
Via API
curl https://supascale.example.com/api/v1/system/activity \ -H "X-API-Key: your-api-key"
Response:
{
"activities": [
{
"id": "act-123",
"type": "project",
"action": "created",
"target": "my-project",
"user": "admin",
"timestamp": "2026-01-19T12:00:00Z",
"details": {
"projectName": "My Project"
}
},
{
"id": "act-124",
"type": "backup",
"action": "completed",
"target": "backup-456",
"timestamp": "2026-01-19T12:30:00Z",
"details": {
"size": 52428800,
"duration": 120
}
}
]
}
Activity Types
| Type | Actions |
|---|---|
auth | login, logout, failed_login |
project | created, started, stopped, deleted |
backup | created, restored, deleted |
task | created, executed, failed |
system | updated, settings_changed |
api_key | created, deleted |
Container Logs
View logs for specific project containers.
Via API
curl "https://supascale.example.com/api/v1/projects/my-project/logs?tail=100" \ -H "X-API-Key: your-api-key"
Filter by Service
# Database logs curl "https://supascale.example.com/api/v1/projects/my-project/logs?service=db" # Auth service logs curl "https://supascale.example.com/api/v1/projects/my-project/logs?service=auth"
Flush Logs
Clear PM2 logs to free disk space:
Via API
# Flush all logs curl -X DELETE https://supascale.example.com/api/v1/system/logs \ -H "X-API-Key: your-api-key" # Flush specific process curl -X DELETE "https://supascale.example.com/api/v1/system/logs?process=supascale-web" \ -H "X-API-Key: your-api-key"
Log Retention
PM2 Log Rotation
Configure PM2 log rotation:
pm2 install pm2-logrotate pm2 set pm2-logrotate:max_size 10M pm2 set pm2-logrotate:retain 7
Activity Log
Activity logs are retained in the database. Consider:
- Archiving old logs periodically
- Setting up log export for compliance
Searching Logs
Via Command Line
# Search PM2 logs pm2 logs supascale-web --lines 1000 | grep "error" # Search with timestamps pm2 logs supascale-web --timestamp | grep "2026-01-19"
Common Searches
| Search | Purpose |
|---|---|
error | Find errors |
failed | Find failures |
timeout | Find timeouts |
warning | Find warnings |
Log Analysis
Common Issues
| Log Pattern | Possible Cause |
|---|---|
ECONNREFUSED | Service not running |
ENOSPC | Disk full |
ENOMEM | Out of memory |
ETIMEDOUT | Network/service timeout |
Debug Tips
- Check timestamps - When did issue start?
- Look for patterns - Recurring errors?
- Correlate events - What happened before error?
- Check resources - Memory/disk issues?
Best Practices
Logging
- Set appropriate log levels in production
- Rotate logs to prevent disk fill
- Monitor log growth trends
- Archive important logs for compliance
Auditing
- Review activity logs regularly
- Track sensitive operations
- Export for compliance requirements
- Set up alerts for suspicious activity
Troubleshooting
No Logs Appearing
- Verify PM2 is running:
pm2 status - Check log file permissions
- Verify log directory exists
- Restart PM2:
pm2 restart all
Logs Growing Too Fast
- Enable log rotation
- Reduce log verbosity
- Filter unnecessary logs
- Increase rotation frequency