> For the complete documentation index, see [llms.txt](https://docs.appfarm.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.appfarm.io/reference/operations/logs.md).

# Logs

The **Logs** view, under **Operations**, shows events recorded across your solution, from [action](/reference/actions.md) and schedule runs to API calls and client performance. It has two modes: **Stream**, a live feed of events as they happen, and **Query**, a search over stored entries. The mode selector is in the top right.

<figure><img src="https://29237295-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiLU-xcHu0eLZiTxcmZ%2Fuploads%2FzfgihhXnVPnV6fEbjYHD%2Fimage.png?alt=media&amp;token=a5616412-040f-482c-94b4-79234ab9a3a9" alt=""><figcaption><p>The Logs view in Appfarm Create</p></figcaption></figure>

{% hint style="info" %}
**Good to know**

Whether a run is logged depends on the platform version the environment runs on. Schedule logs are produced from version 156, and service logs from version 157. An environment on an older version, such as a production environment that has not been upgraded, does not produce these logs.
{% endhint %}

## Modes

**Stream** shows entries live as they are produced, so you can watch activity in real time while testing or debugging.

**Query** searches stored entries. Set the filters and time range, then click **Run query** to load matching entries.

## Filtering

The filter bar sits above the results. You can filter by:

* **All severities**: the [severity](#severity) level.
* **All environments**: the environment the entry was recorded in.
* **All sources**: the [log source](#log-sources).
* **Filter by message text**: a free-text match on the entry message.
* **Add filter**: further field-based filters on entry metadata.

The time range selector (for example, **Last 7 days**) sets the period to search. In **Query** mode, click **Run query** to apply the current filters.

## Results

The results table has three columns: **Severity**, **Local time**, and **Summary**. The **Summary** column tags each entry with its environment and source, followed by the message. Expand a row using the chevron on the left to see its full detail and metadata. See [Entry fields](#entry-fields) for what is recorded.

### Distribution

Above the results, the **Distribution** chart shows the volume of matching entries over the selected time range, colored by severity. The total entry count for the current result set is shown alongside it. Clicking a bar in the **Distribution** chart narrows the results to that time range.

### Exporting

Download the current result set as JSON using the download button above the results.

## Log sources

Each entry belongs to a source. A source is a stream of one kind of event, with its own metadata. Filter by source with **All sources**.

| Source                                        | What it captures                                                                                                                                                                                  |
| --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [**Action**](#action)                         | [Flow](/reference/flows.md), [service](/reference/services.md) and [app](/reference/apps.md) action runs. Logging must be enabled per action. Read more [here](/reference/actions.md#properties). |
| [**Scheduler**](#scheduler)                   | Flow and service schedule runs.                                                                                                                                                                   |
| [**API request**](#api-request)               | Calls to service and flow API endpoints.                                                                                                                                                          |
| [**Client performance**](#client-performance) | Client-side performance in your apps, keyed by app and user.                                                                                                                                      |

## Entry fields

Every entry carries a common set of fields, followed by metadata specific to its source. Expand a row to see them.

| Field           | Description                                                                            |
| --------------- | -------------------------------------------------------------------------------------- |
| **Timestamp**   | When the event occurred, in UTC.                                                       |
| **Severity**    | The entry's [severity](#severity) level.                                               |
| **Source**      | The [log source](#log-sources).                                                        |
| **Environment** | The [environment](/reference/configuration/environments.md) the event was recorded in. |
| **Version**     | The platform build the solution was running.                                           |
| **Message**     | A short summary of the event.                                                          |

### Action

Action runs are logged only when **Enable Log** is selected on the action's **Action settings** tab. **Custom Log Fields** set up there are recorded under `customFields` on the entry, alongside the metadata below. Read more on how to set up action logging [here](/reference/actions.md#debugging).

| Field               | Description                                                   |
| ------------------- | ------------------------------------------------------------- |
| `action_id`         | The action that ran.                                          |
| `action_node_id`    | The action node in focus. On a failure, the node that failed. |
| `app_id`            | The app the action ran in.                                    |
| `execution_time_ms` | How long the run took, in milliseconds.                       |
| `status`            | The run result, for example `completed` or `failed`.          |
| `user_id`           | The user the action ran as.                                   |
| `error_code`        | On a failure, the error code.                                 |
| `error_name`        | On a failure, the error type.                                 |
| `error_message`     | On a failure, the error message.                              |

### Scheduler

| Field              | Description                                                        |
| ------------------ | ------------------------------------------------------------------ |
| `schedule_id`      | The schedule that ran.                                             |
| `schedule_name`    | The schedule's name.                                               |
| `duration_ms`      | How long the run took, in milliseconds.                            |
| `execution_status` | The run result, for example `completed`.                           |
| `method`           | For a service schedule, the HTTP method used to call the endpoint. |
| `status_code`      | For a service schedule, the HTTP status code returned.             |
| `status_text`      | For a service schedule, the HTTP status text returned.             |
| `url`              | For a service schedule, the endpoint URL called.                   |

`schedule_id`, `schedule_name`, `duration_ms`, and `execution_status` apply to both flow and service schedules. The remaining fields apply only to service schedules, which run by calling an endpoint.

### API request

The identifier fields depend on the endpoint type, and some fields depend on whether the call ran synchronously or asynchronously.

| Field                               | Description                                                           |
| ----------------------------------- | --------------------------------------------------------------------- |
| `flow_id`, `flow_endpoint_id`       | For a flow API endpoint, the flow and the endpoint that was called.   |
| `service_id`, `service_endpoint_id` | For a service endpoint, the service and the endpoint that was called. |
| `method`                            | The HTTP method used.                                                 |
| `url`                               | The request URL.                                                      |
| `execution_status`                  | The result, for example `completed`.                                  |
| `status_code`                       | The HTTP status code returned, on a synchronous request.              |
| `duration_ms`                       | How long the request took, in milliseconds.                           |
| `async_job`                         | Whether the request ran asynchronously.                               |
| `job_id`                            | An identifier for the job, on an asynchronous request.                |
| `triggered_by`                      | What triggered the request, for example `user`.                       |
| `user_id`                           | The user the request ran as.                                          |

### Client performance

Logs the data size and the loading time every time a user loads an app in the solution.

| Field         | Description                                                                         |
| ------------- | ----------------------------------------------------------------------------------- |
| `app_id`      | The app the metric came from.                                                       |
| `metric_name` | The metric that was recorded, for example `initial_data_size` or `app_loaded_time`. |
| `value`       | The metric value.                                                                   |
| `user_id`     | The user the metric was recorded for.                                               |
| `user_agent`  | The browser user agent.                                                             |

## Severity

Each entry has a severity, shown in the **Severity** column. The **All severities** filter selects which levels appear, from highest to lowest: **Emergency**, **Critical**, **Error**, **Warning**, **Notice**, **Info**, and **Debug**.

The **Match** setting controls how the choice applies. **And higher** shows the selected level and every level above it. **Exact** shows only the selected level.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.appfarm.io/reference/operations/logs.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
