Skip to main content
GET
GET /api/logs
The GET /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=error
string
Filter by environment name.Example: /api/logs?environment=production
string
Filter by application ID.Example: /api/logs?appId=my-frontend-app
Full-text search across message and stack fields.Example: /api/logs?search=TypeError
string
Filter logs created after this date (ISO 8601).Example: /api/logs?startDate=2024-01-01T00:00:00Z
string
Filter logs created before this date (ISO 8601).Example: /api/logs?endDate=2024-01-31T23:59:59Z
number
default:"1"
Page number for pagination (1-indexed).Example: /api/logs?page=2
number
default:"50"
Number of results per page (max: 100).Example: /api/logs?limit=100
string
default:"timestamp"
Field to sort by.Values: timestamp, severity, appId, environmentExample: /api/logs?sortBy=severity
string
default:"desc"
Sort order.Values: asc (ascending), desc (descending)Example: /api/logs?sortOrder=asc
string
Filter by error group fingerprint.Example: /api/logs?group=abc123def456

Response 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

Combined Filters

Pagination

Navigate through large result sets:
Response includes:
  • total - Total matching logs
  • page - Current page
  • limit - Items per page
  • pages - Total pages
Calculate next page:

Sorting

Sort results by different fields:

Performance Considerations

Always include time filters to reduce query scope:
Use reasonable page sizes:
Maximum allowed: 100 items per page
These fields are indexed for fast queries:
  • timestamp
  • severity
  • environment
  • appId
  • group
Metadata fields are not indexed by default.
Full-text search uses MongoDB text index:

Client Implementation

JavaScript/TypeScript

Python

Rate Limiting

No rate limiting by default. Implement rate limiting in production.
Recommended limits:
  • 100 requests per minute per IP
  • 1,000 requests per hour per user

Caching

Responses can be cached for performance:
Cache key should include:
  • All query parameters
  • Current time bucket (e.g., minute)

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