---
title: "iOS SDK: Console logs"
description: "Capture console logs for bug reports with the Gleap iOS SDK. Follow the integration code examples."
url: https://docs.gleap.ai/en/articles/445-ios-sdk-console-logs
collection: "iOS"
updated: 2026-11-01
language: en
---

# iOS SDK: Console logs

Capture console logs for bug reports with the Gleap iOS SDK. Follow the integration code examples.

The Gleap iOS SDK collects console logs by default, in debug and release builds, and attaches the last 500 entries to every ticket. On top of that you can add [custom logs](#custom-logs).

## Default console logs

Gleap collects:

-   **Standard output and error**: everything your app writes with `print()`, `NSLog` or to `stdout` / `stderr`. The output still shows up in the Xcode console.
    
-   **Unified logging**: messages your app's process sends with `os_log` or `Logger` (for example React Native's JavaScript console). Errors and faults are marked as errors. Values that are not logged with `privacy: .public` show as `<private>`, as they do in Console.app.
    
-   **Custom logs** added with `Gleap.log`.
    

Standard output and error (`print`, `NSLog`) are captured in debug and release builds. Unified logging entries (`os_log`, `Logger`) are read from the last 180 seconds only, at most 300 of them. Entries are cut at 1000 characters (5000 for `ERROR` entries) and marked `… [truncated]`. To opt out, call `disableConsoleLog()` before initializing Gleap (see below).

> **Note:** This applies to SDK **v19.0.0** and newer. Older versions collected only `os_log` messages on iOS 15 and later (`print` output was missing and `NSLog` showed as `<private>`), and needed `enableDebugConsoleLog` in debug builds. `enableDebugConsoleLog` is no longer needed and has no effect.

### Disable default console logs

It is possible to disable the default collection of console logs by calling the following method prior to the initialization of Gleap. Custom logs are still attached.

**Swift**

```swift
Gleap.disableConsoleLog()
```

**Objective-C**

```objectivec
[Gleap disableConsoleLog];
```

## Custom logs

Custom logs allow you to create logs in the Gleap activity log. There are three severity types available for logs: `ERROR`, `WARNING` and `INFO`.

**Swift**

```swift
Gleap.log("This is a test log.")
```

**Objective-C**

```objectivec
[Gleap log: @"This is a test log."];
```

By default logs will be created with the severity `INFO`. Use the following method to explicitly set the severity.

**Swift**

```swift
Gleap.log("This is a test error.", with: ERROR)
```

**Objective-C**

```objectivec
[Gleap log: @"This is a test error." withLogLevel: ERROR];
```

## Related

- [iOS SDK setup](https://docs.gleap.ai/en/articles/434-ios-sdk-setup.md)
- [iOS SDK: User identity](https://docs.gleap.ai/en/articles/435-ios-sdk-user-identity.md)
- [iOS SDK: Callbacks](https://docs.gleap.ai/en/articles/436-ios-sdk-callbacks.md)
- [iOS SDK: Frontend tools](https://docs.gleap.ai/en/articles/437-ios-sdk-frontend-tools.md)
- [iOS SDK: Forms](https://docs.gleap.ai/en/articles/438-ios-sdk-forms.md)
