# Debug Logs

{% hint style="warning" %}
Note by default, a user needs to be authenticated to view debug logs for their app. See [App Permissions](https://docs.appetize.io/platform/app-management/app-permissions) 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](https://docs.appetize.io/platform/query-params-reference#debug) for more information.

### With JavaScript SDK

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

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

See [Configuration](https://docs.appetize.io/javascript-sdk/configuration#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="https://2147444700-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJUveBCJfn0GR8-hlqi%2Fuploads%2Fro8Wl5iKd0sBn88Dsnam%2FScreenshot%202025-03-21%20113309.png?alt=media&#x26;token=baf5e694-9eeb-4cd5-85e1-2561b33a03d6" 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="https://2147444700-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJUveBCJfn0GR8-hlqi%2Fuploads%2Ff23pGGmN93f5vuaQWOKV%2FScreenshot%202025-03-21%20113852.png?alt=media&#x26;token=ba150629-4cde-44a5-93b9-062d92e59a65" 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](https://docs.appetize.io/javascript-sdk/api-reference#on-1) for more information.
