Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 09:06:02 +08:00
commit 02cab85880
53 changed files with 12367 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
# Logs API
## Overview
The Logs API provides access to application logs, including authentication logs, request logs, and custom logs.
## Get Request Logs
```http
GET /api/logs/requests?page=1&perPage=50&filter=created>="2024-01-01"
Authorization: Bearer {admin_token}
```
Response:
```json
{
"page": 1,
"perPage": 50,
"totalItems": 100,
"totalPages": 2,
"items": [
{
"id": "log_id",
"method": "GET",
"url": "/api/collections/posts/records",
"status": 200,
"duration": 15,
"remoteIP": "192.168.1.1",
"userAgent": "Mozilla/5.0...",
"referer": "",
"created": "2024-01-01T00:00:00.000Z"
}
]
}
```
## Get Auth Logs
```http
GET /api/logs/auth?page=1&perPage=50
Authorization: Bearer {admin_token}
```
## Get Raw Logs
```http
GET /api/logs?type=request&level=error&page=1&perPage=50
Authorization: Bearer {admin_token}
```
---
**Note:** This is a placeholder file. See [core/going_to_production.md](../core/going_to_production.md) for logging best practices.