API Maker

The framework for AI era

Operations

API Logging

Every call you choose, with its request, response, console output and timing, searchable in the admin panel.

A log profile lists what to log: generated, custom and system APIs, events, schedulers and WebSocket events, and whether to keep their response. Logs are written after the response, in batches, to a log database of their own. The log explorer finds any call and exports the list.

See it live

Step through it, slow it down, or open the full canvas.

api-maker/features/logging-apiLive
  • Call
  • Response
  • Log
  • Log database
Logged
0calls
In memory
0of 10 000
Batches
0written
Before the response
0log writes

Choose what is logged. The default log profile lists the APIs to log: generated, custom and system APIs, events, schedulers. For each one, save the response or not.

How it works

  1. Choose what is logged.

    The default log profile lists the APIs to log: generated, custom and system APIs, events, schedulers. For each one, save the response or not.

  2. Logging never delays a call.

    The response goes out first, then the log is queued in memory. A call of an API that is not in the profile is not logged at all.

  3. Written in batches, never a burden.

    Up to 1000 logs per write, or every 5 seconds. If the log database is slow, at most 10 000 logs wait in memory and a failed batch is dropped: the server keeps serving.

  4. Everything about a call.

    Request body, query, params and headers, the response if the profile saves it, console output, errors, status and time. The time to get a sandbox is not counted.

  5. Find any call, export the list.

    Filter by time, text, fields and duration, sort by the slowest, follow new logs live, and export the list as CSV or JSON. Old logs are removed past your limit.

What you get

Profile based

Pick the APIs, events, schedulers and WebSocket events to log, and for each one whether its response is saved.

Never in the way

The response goes out first. Logs are written in batches of up to 1000, or every 5 seconds, and at most 10,000 wait in memory.

Everything about a call

Body, query, parameters and headers, the response if kept, console output of your code, errors, status and execution time.

Find it fast

Filter by time, text, fields and duration, sort by the slowest calls, and follow new logs as they arrive.

Export

Export the filtered list as CSV or JSON for reports or other tools.

Cleans itself

A daily job removes the oldest logs beyond maxLogsCount, so the log database does not grow without end.

An example

Why was this order rejected?

Support searches the logs for the order id, opens the call, and sees the body the app sent, the validation error it got, and the console output of the pre hook that refused it.

Good to know

  • When the log database falls behind and 10,000 logs are waiting, the oldest waiting logs are dropped instead of slowing down the APIs.
  • Keeping responses in logs uses space: turn it on only for the APIs where you need it.

Questions

Can I switch logging off?

Yes. logs.enableLogs turns it off for the server. The monitoring dashboards keep working, they do not read the logs.

Is the time of the sandbox counted?

No. The time spent waiting for a sandbox is not counted in the execution time of a call.