# Debug Logs

{% hint style="warning" %}
Note by default, a user needs to be authenticated to view debug logs for their app. See [App Permissions](/platform/app-management/app-permissions.md) for more information.
{% endhint %}

## Capture Debug Logs

{% hint style="info" %}
Debug logs are generated by your app using [`NSLog`](https://developer.apple.com/documentation/foundation/1395275-nslog) or [`Logger`](https://developer.apple.com/documentation/os/logger) for iOS and [`Log`](https://developer.android.com/reference/android/util/Log) for Android
{% endhint %}

To enable Appetize to capture all debug log events, you can choose to enable it through a query parameter or with the help of the JavaScript SDK.

### With Query Parameter

Add the `debug=true` query parameter to your app or embed URL

```uri
&debug=true
```

See [Query Params Reference](/platform/query-params-reference.md#debug) for more information.

### With JavaScript SDK

Set `debug: true` in the configuration e.g.

```typescript
await client.setConfig({
    debug: true,
    ...
})
```

See [Configuration](/javascript-sdk/configuration.md#debug) for more information.

## Inspecting Debug Logs

### With App Page

The app page provides a simple debug log of all the events that took place. You can access this via your app's app link

{% code overflow="wrap" %}

```url
https://appetize.io/app/{appId|buildId|publicKey}?&debug=true
```

{% endcode %}

or by going to your [Apps](https://appetize.io/apps) page, selecting the app you want to inspect, and then clicking `debug` on the latest build or choosing a specific build you would like to debug.

<figure><img src="/files/aH0sPUouf1OLtnfG6rEn" alt=""><figcaption><p>Select <code>Debug</code> for the app or a specific build</p></figcaption></figure>

{% hint style="info" %}
Debug logs can also be downloaded via the `Download Logs` action at the top right of the log viewer. This is helpful when sharing logs with developers for troubleshooting purposes.
{% endhint %}

<figure><img src="/files/EyW1X6r1DjuDcYBT7BA5" alt="Example Debug logs from App Page"><figcaption></figcaption></figure>

### With JavaScript SDK

You can listen for all debug log events via our JavaScript SDK. To easily view them in the browser you can print them to the console or you can store it to file for later analysis

```typescript
// check debug logs
session.on('log', (data) => {
    console.log(data.message)
})
```

See our JavaScript [API Reference](/javascript-sdk/api-reference.md#on-1) for more information.


---

# Agent Instructions: 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:

```
GET https://docs.appetize.io/features/debug-logs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
