Working with Logs

Monitor incoming requests and create endpoints from real traffic

What are Logs?

EchoMock automatically logs every request made to your mock APIs. These logs provide valuable insights into how your endpoints are being used and help you create new request handlers based on actual traffic.

💡 Key Feature: Logs are displayed in real-time on the dashboard, showing you exactly what requests are hitting your mock APIs.

Understanding the Logs Table

The logs table displays comprehensive information about each request:

Column Description
Application The application that received the request
Request HTTP method and URL path of the request
Match Percentage indicating how well the request matched an endpoint (0-100%)
Found Whether a matching request handler was found (yes/no)
Status HTTP status code returned
Duration How long the request took to process
Time When the request was received
Tags Any tags associated with the matched request handler

Filtering and Searching Logs

Filter by Application

Use the application dropdown to view logs for a specific application or select "All applications" to see everything.

Search Logs

Use the search box to find specific requests by URL, method, or other criteria.

Example searches:

  • /users - Find all user-related requests
  • GET - Find all GET requests
  • 404 - Find all requests that returned 404

Filter by Date Range

Click the date range button to select a specific time period. This is useful for analyzing traffic patterns or debugging issues that occurred at a specific time.

Filter by Tags

Click the funnel icon in the Tags column to filter logs by specific tag values. This is particularly useful when you have multiple request handlers with different scenarios.

💡 Pro Tip: You can filter multiple tags at once to narrow down specific request scenarios.

Real-time Polling

Click the refresh/arrow button to toggle automatic polling. When enabled, the logs table will automatically refresh every 10 seconds to show new requests.

  • Loading icon: Polling is active
  • Static arrow: Polling is paused

Creating Requests from Logs

One of EchoMock's most powerful features is the ability to create request handlers directly from logged traffic. This is perfect for:

  • Capturing real-world request patterns
  • Quickly creating endpoints for requests that returned 404
  • Building mock APIs based on actual API usage
  • Testing edge cases discovered in production

Step-by-Step Guide

1

Find the Log Entry

Browse or search the logs table to find the request you want to convert into a request handler. Look for requests that returned unexpected results or 404 errors.

2

Click the View Button

Hover over the log entry to reveal the action buttons, then click the eye icon to view the log details.

Tip: The eye icon appears in the Actions column on the right side of the table.

3

Review Log Details

A modal will open showing detailed information about the request:

  • Parameters: Query parameters and request body
  • Response: The response that was returned (if any)
  • Headers: All HTTP headers from the request
4

Click "Add Request"

At the bottom of the log details modal, click the blue "Add request" button.

Note: This button is only visible if you have permission to manage requests.

5

Configure the Request Handler

You'll be taken to the endpoint edit page with a new request form. The form will be pre-filled with data from the log:

  • Method: The HTTP method from the log
  • Accept: The Accept header from the request
  • Parameters: Any query parameters or body data
  • Headers: Request headers
6

Customize the Response

Now configure how you want this endpoint to respond:

  • Set the status code (200, 404, 500, etc.)
  • Write a custom response body (use special entities like <random:int>)
  • Add a delay if needed
  • Set the content type
  • Add tags for organization
✓

Save and Test

Click "Save" to create the request handler. The next time a similar request is made, it will match this handler and return your configured response!

Complete Example

Here's a real-world scenario of creating a request from logs:

Scenario: 404 Not Found

A client is making requests to /api/products/123 but getting 404 errors because the endpoint doesn't exist yet.

Log Entry Shows:

Application: My API
Method: GET
URL: /api/products/123
Status: 404
Match: 50%
Found: no

Steps Taken:

  1. Clicked the eye icon to view log details
  2. Reviewed the request headers and parameters
  3. Clicked "Add request" button
  4. Configured the response with product data
  5. Saved the request handler

New Request Handler Created:

Endpoint: /api/products/{id}
Method: GET
Status: 200
Response:
{
  "id": <random:int>,
  "name": "Product <random:word>",
  "price": <random:float:between 10 and 100>,
  "inStock": true
}

✓ Result: Success!

Future requests to /api/products/* now return proper product data with a 200 status code.

Best Practices

✓ Monitor Regularly

Check your logs frequently to identify missing endpoints or unexpected request patterns.

✓ Use Tags for Filtering

Add tags to your request handlers to make it easier to filter and analyze logs later.

✓ Enable Polling During Testing

Turn on automatic polling when actively testing to see requests in real-time.

✓ Create from 404s

Prioritize creating request handlers for requests that returned 404 errors.

✓ Review Match Percentages

Low match percentages indicate requests that don't align well with existing endpoints.

✓ Delete Old Logs

Periodically clean up old log entries to keep your dashboard focused on recent activity.

Common Use Cases

Building API Coverage

As your frontend makes requests to your mock API, use the logs to identify which endpoints are needed and create them on the fly.

Debugging Integration Issues

When integration tests fail, check the logs to see exactly what requests were made and what responses were returned.

Testing Edge Cases

Capture unusual request patterns from logs and create specific request handlers to test how your application handles them.

Performance Testing

Use the duration column to monitor response times and add delays to specific endpoints to simulate slow APIs.

Congratulations!

You now know how to use EchoMock to create and manage mock APIs. Start by creating your first application and building endpoints based on your needs!

Back to Getting Started