Access and monitor logs across your SimplyStack projects for debugging and analytics.
Logs API
The Logs API provides access to logs across all your SimplyStack projects. Use it for debugging, monitoring, and analytics.
Authentication
Logs API requires a personal API key to access logs across all your projects. Get your personal API key from account settings.
List Logs
GET /api/v1/logs
Retrieve logs with filtering and pagination.
Query Parameters:
- project_id - Filter by specific project
- level - Log level (info, warn, error, debug)
- start_date - Filter logs from this date
- end_date - Filter logs until this date
- page - Page number (default: 1)
- limit - Items per page (max: 100, default: 50)
JavaScript
const response = await fetch(
'https://www.simplystack.dev/api/v1/logs?level=error&limit=20',
{ headers: { 'x-api-key': 'your-personal-api-key' } }
);
const { data, pagination } = await response.json();
console.log('Error logs:', data);Get Log Details
GET /api/v1/logs/{id}
Get detailed information for a specific log entry.
JavaScript
const response = await fetch(
`https://www.simplystack.dev/api/v1/logs/${logId}`,
{ headers: { 'x-api-key': 'your-personal-api-key' } }
);
const { data } = await response.json();Log Levels
- debug - Detailed debugging information
- info - General informational messages
- warn - Warning messages
- error - Error conditions
Response Format
JSON
{
"data": [
{
"id": "log-uuid",
"project_id": "project-uuid",
"level": "error",
"message": "Error message",
"metadata": {},
"timestamp": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"page": 1,
"limit": 50,
"total": 1250
}
}Best Practices
- Use date filters to narrow down results
- Filter by level to focus on specific issues
- Implement pagination for large log sets
- Monitor error logs regularly
- Archive old logs periodically