Working with APIs

Request Logs & Activity Monitoring

Track, analyze, and debug API requests with comprehensive logging and activity history

What are Request Logs?

Request logs capture every API call made to your mock endpoints, providing detailed information about:

Request Details
  • • Timestamp of request
  • • HTTP method used
  • • Endpoint path called
  • • Query parameters
Response Information
  • • Status code returned
  • • Response time (ms)
  • • Response body size
  • • Headers sent/received
Client Information
  • • IP address
  • • User agent
  • • Referer URL
  • • Request origin
Error Tracking
  • • Error messages
  • • Validation failures
  • • Rate limit violations
  • • Authentication issues

Accessing Request Logs

From the Dashboard

Step 1: Navigate to Project

Go to your project's overview page from the dashboard

Step 2: Click "Logs" Tab

Access the request logs section in the project navigation

Step 3: View Real-Time Activity

See live updates as requests come in (auto-refreshes every 5 seconds)

Direct URL Access

Quickly access logs for any project:

https://mock-api-builder.com/logs?projectId=your-project-id

Log Data Structure

Each log entry contains comprehensive information about the request:

Example Log Entry
json

Filtering & Search

Filter by HTTP Method

View only specific types of requests:

GETPOSTPUTPATCHDELETE
Filter by Status Code

Find requests by response status:

2xx Success
3xx Redirect
4xx Client Error
5xx Server Error
Filter by Time Range

Select a specific time period:

  • • Last hour
  • • Last 24 hours
  • • Last 7 days
  • • Last 30 days
  • • Custom date range
Search by Endpoint Path

Search for specific endpoints or patterns:

/api/users/api/*/comments

Log Analytics & Insights

Request Volume

Track API usage over time:

  • • Requests per hour/day
  • • Peak usage times
  • • Traffic trends
  • • Endpoint popularity
Response Times

Monitor API performance:

  • • Average response time
  • • Slowest endpoints
  • • 95th percentile latency
  • • Performance trends
Error Rates

Identify problematic patterns:

  • • 4xx error frequency
  • • 5xx error tracking
  • • Most common errors
  • • Error rate trends
User Activity

Understand user behavior:

  • • Unique IP addresses
  • • User agent distribution
  • • Geographic patterns
  • • Authentication success

Exporting Logs

Export Options

JSON Export

Download logs in JSON format for programmatic analysis:

GET /api/logs/export?projectId=xxx&format=json&from=...&to=...

CSV Export

Download logs as CSV for spreadsheet analysis:

GET /api/logs/export?projectId=xxx&format=csv&from=...&to=...

Filtered Exports

Apply the same filters used in the UI when exporting data

Log Retention & Limits

Storage Limits

• Logs are retained for 30 days

• Maximum 100,000 log entries per project

• Older logs are automatically deleted

• Export logs regularly for long-term storage

Common Use Cases

Debugging Integration Issues

When a frontend developer reports "the API isn't working," check the logs to see:

  • • Are requests reaching the endpoint?
  • • What status codes are being returned?
  • • Are the request parameters correct?
  • • Are there any authentication issues?
Monitoring Rate Limit Usage

Track how close clients are getting to rate limits:

  • • View X-RateLimit-Remaining values
  • • Identify clients hitting limits frequently
  • • Adjust limits based on actual usage
Testing API Behavior

Verify that your mock API behaves as expected:

  • • Confirm CORS headers are present
  • • Validate response times
  • • Check authentication flows
  • • Verify error handling
Demonstrating API Usage

Show stakeholders or clients how the API is being used:

  • • Real-time request monitoring
  • • Usage statistics and trends
  • • Performance metrics
  • • Error tracking

Best Practices

  • Check logs regularly during development to catch issues early
  • Use filters to focus on specific types of requests or time periods
  • Export logs before they expire if you need long-term storage
  • Monitor error rates to identify and fix problematic endpoints
  • Review response times to ensure your mock API performs well
  • Use search to quickly find specific requests or patterns
  • Share log views with team members when troubleshooting together