---
source_url: https://www.pubnub.com/docs/chat/swift-chat-sdk/build/features/error-logging
title: Error logging
updated_at: 2026-05-25T05:44:04.153Z
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# Error logging

## How to enable logging

Logging is disabled by default ([LogLevel.off](https://www.pubnub.com/docs/chat/swift-chat-sdk/build/configuration#initialize-pubnub)). Available logging options:

| Value | Description |
| --- | --- |
| `error` | Used for logging error messages. |
| `warn` | Used for logging warning messages. |
| `info` | Used for logging informational messages. |
| `debug` | Used for logging debug messages. |
| `verbose` | The most detailed level of logging. It includes everything at the `debug` level and more fine-grained information. |

Set `LogLevel` in `ChatConfiguration` to enable logging.

```swift
// Create PubNub configuration
let pubNubConfiguration = PubNubConfiguration(
  publishKey: "your-publish-key",
  subscribeKey: "your-subscribe-key",
  userId: "your-user-id"
  // Add other required parameters
)
  
// Create Chat configuration
let chatConfiguration = ChatConfiguration(
  logLevel: .info
)
  
// Create ChatImpl instance
let yourChat = ChatImpl(
  chatConfiguration: chatConfiguration,
  pubNubConfiguration: pubNubConfiguration
)
```