> ## Documentation Index
> Fetch the complete documentation index at: https://docs.revoengine.com/llms.txt
> Use this file to discover all available pages before exploring further.

# api.log()

> Public low-code contract, signatures and examples for api.log.

## `api.log()`

Adds a log entry.

Limits:

* INFO and DEBUG share a budget of 100 emitted entries in Endpoint executions,
  or 10,000 in Processor and Sandbox executions, including streaming Sandbox.
* WARN and ERROR each have a separate budget of 100 emitted entries.
* Error evidence remains in the execution result even after emission is
  limited: a bounded sample retains the first errors and the most recent one.
* Sampled-out messages are counted by level. A bounded aggregate appears when
  sampling starts, on further activity at most once per minute, and on final
  telemetry when counts changed. Other API methods do not consume this budget.
* Streaming Sandbox sends entries to its active SSE stream, which also has a
  backpressure queue limit.

### Signature

```ts theme={null}
static log(
      log: string | LogInterface,
      type?: 'ERROR' | 'WARN' | 'INFO' | 'DEBUG',
      duration?: number,
      time?: string,
    ): void;
```

### Example

```ts theme={null}
api.log(
  { message: 'Call finished', args: { status: 200 } },
  'INFO',
  120,
);
```

See [all api methods](https://docs.revoengine.com/low-code/reference/api.md) or [runtime basics](https://docs.revoengine.com/low-code/overview.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.