curl -X GET 'https://api.weir.ai/logs/all?type=ERROR&scheme=admin&page=1&limit=10&startDate=2024-01-01&endDate=2024-01-31' \
-H 'Authorization: Bearer YOUR_ADMIN_ACCESS_TOKEN'
{
"data": {
"logs": [
{
"logId": "log_123456789",
"type": "ERROR",
"message": "Database connection failed",
"timestamp": "2024-01-22T15:30:00Z",
"scheme": "admin",
"severity": "high",
"metadata": {
"source": "database",
"retryAttempts": 3
}
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 150,
"totalPages": 15
}
},
"message": "Logs retrieved successfully",
"status": "success"
}
Retrieve all log entries with filtering
curl -X GET 'https://api.weir.ai/logs/all?type=ERROR&scheme=admin&page=1&limit=10&startDate=2024-01-01&endDate=2024-01-31' \
-H 'Authorization: Bearer YOUR_ADMIN_ACCESS_TOKEN'
{
"data": {
"logs": [
{
"logId": "log_123456789",
"type": "ERROR",
"message": "Database connection failed",
"timestamp": "2024-01-22T15:30:00Z",
"scheme": "admin",
"severity": "high",
"metadata": {
"source": "database",
"retryAttempts": 3
}
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 150,
"totalPages": 15
}
},
"message": "Logs retrieved successfully",
"status": "success"
}
curl -X GET 'https://api.weir.ai/logs/all?type=ERROR&scheme=admin&page=1&limit=10&startDate=2024-01-01&endDate=2024-01-31' \
-H 'Authorization: Bearer YOUR_ADMIN_ACCESS_TOKEN'
{
"data": {
"logs": [
{
"logId": "log_123456789",
"type": "ERROR",
"message": "Database connection failed",
"timestamp": "2024-01-22T15:30:00Z",
"scheme": "admin",
"severity": "high",
"metadata": {
"source": "database",
"retryAttempts": 3
}
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 150,
"totalPages": 15
}
},
"message": "Logs retrieved successfully",
"status": "success"
}
Show Log Properties
const getAllLogs = async (filters, accessToken) => {
const params = new URLSearchParams(filters);
const response = await fetch(`https://api.weir.ai/logs/all?${params}`, {
headers: { 'Authorization': `Bearer ${accessToken}` }
});
if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
return await response.json();
};
// Usage
const logs = await getAllLogs({
type: 'ERROR',
scheme: 'admin',
page: 1,
limit: 50,
startDate: '2024-01-01',
endDate: '2024-01-31'
}, 'your_access_token');
INFO
WARNING
ERROR
DEBUG
Was this page helpful?