GET /api/logs
Ingestion API
GET /api/logs
Retrieve error logs with filtering and pagination
GET
GET /api/logs
The GET
Response includes:
Recommended limits:
Cache key should include:
/api/logs endpoint retrieves stored error logs with support for filtering, searching, sorting, and pagination.
Query Parameters
string
Filter by severity level.Values:
error, warning, infoExample: /api/logs?severity=errorstring
Filter by environment name.Example:
/api/logs?environment=productionstring
Filter by application ID.Example:
/api/logs?appId=my-frontend-appstring
Full-text search across message and stack fields.Example:
/api/logs?search=TypeErrorstring
Filter logs created after this date (ISO 8601).Example:
/api/logs?startDate=2024-01-01T00:00:00Zstring
Filter logs created before this date (ISO 8601).Example:
/api/logs?endDate=2024-01-31T23:59:59Znumber
default:"1"
Page number for pagination (1-indexed).Example:
/api/logs?page=2number
default:"50"
Number of results per page (max: 100).Example:
/api/logs?limit=100string
default:"timestamp"
Field to sort by.Values:
timestamp, severity, appId, environmentExample: /api/logs?sortBy=severitystring
default:"desc"
Sort order.Values:
asc (ascending), desc (descending)Example: /api/logs?sortOrder=ascstring
Filter by error group fingerprint.Example:
/api/logs?group=abc123def456Response Fields
array
Array of error log objects.
number
Total number of logs matching the query.
number
Current page number.
number
Results per page.
number
Total number of pages.
Example Requests
Example Response
Error Responses
Filtering Examples
By Severity
By Environment
By Application
By Date Range
Full-Text Search
Combined Filters
Pagination
Navigate through large result sets:total- Total matching logspage- Current pagelimit- Items per pagepages- Total pages
Sorting
Sort results by different fields:Performance Considerations
Use time filters
Use time filters
Always include time filters to reduce query scope:
Limit page size
Limit page size
Use reasonable page sizes:Maximum allowed: 100 items per page
Use indexed fields
Use indexed fields
These fields are indexed for fast queries:
timestampseverityenvironmentappIdgroup
Text search performance
Text search performance
Full-text search uses MongoDB text index:
Client Implementation
JavaScript/TypeScript
Python
Rate Limiting
No rate limiting by default. Implement rate limiting in production.
- 100 requests per minute per IP
- 1,000 requests per hour per user
Caching
Responses can be cached for performance:- All query parameters
- Current time bucket (e.g., minute)
Related Endpoints
POST /api/logs
Send error logs to VIJ
GET /api/stats
Get error statistics
GET /api/groups
Retrieve error groups
Filtering Guide
Advanced filtering techniques