> ## Documentation Index
> Fetch the complete documentation index at: https://docs.discord.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Debug & Log

> Learn how to enable and use debug logging in the Discord Social SDK.

## Overview

This guide will help you understand how to install debugging symbols and handle logging to assist in building your Discord Social SDK integration.

## Debugging

Debugging symbols are hosted at [https://storage.googleapis.com/discord-public-symbols](https://storage.googleapis.com/discord-public-symbols). If using Visual Studio, you can add this link to the pdb locations under `Tools > Options > Debugging > Symbols`.

<Info>
  Note: You won't be able to browse files using that link, but that's ok. Individual files are accessible under the domain, and the URL functions properly as a symbol server, so it works in Visual Studio.
</Info>

## Logging

You can access Discord's logs with [`Client::AddLogCallback`]. The [`Client::SetLogDir`] function will write the SDK's logs to that directory if set.

<Info>
  For production builds, use `ERROR (4)` or `WARN (3)` severity levels. For development builds, you can use `INFO (2)` or `VERBOSE (1)` severity levels to get more detailed logs.
</Info>

```cpp theme={"system"}
client->AddLogCallback([](auto message, auto severity) {
  std::cout << "[" << EnumToString(severity) << "] " << message << std::endl;
}, discordpp::LoggingSeverity::Info);
```

### Voice Logging

The voice subsystem (including the underlying WebRTC infrastructure) has its own dedicated logging separate from the main SDK log stream. You have two options:

* [`Client::SetVoiceLogDir`] — writes voice logs to disk in the specified directory.
* [`Client::AddVoiceLogCallback`] — delivers voice log messages to a callback in your application.

These can be used together, but [`Client::SetVoiceLogDir`] **must** be called immediately after Client construction,
before any call that initializes the voice subsystem (including [`Client::AddVoiceLogCallback`]). Calling it after the voice subsystem has started has no effect.

```cpp theme={"system"}
// Must be called right after constructing the client, before anything else
client->SetVoiceLogDir("/path/to/log/dir", discordpp::LoggingSeverity::Info);

// Can be called any time after construction
client->AddVoiceLogCallback([](auto message, auto severity) {
  std::cout << "[Voice][" << EnumToString(severity) << "] " << message << std::endl;
}, discordpp::LoggingSeverity::Info);
```

<Tip>
  Voice logs are generated by the voice subsystem and WebRTC layer independently of the main SDK logs captured by [`Client::AddLogCallback`]. If you are diagnosing voice or call quality issues, enable voice logging in addition to the main log callback.
</Tip>

### Audio Logging

For diagnosing issues with acoustic echo cancellation (AEC), you can use the [`Client::SetAecDump`] function. This
enables diagnostic recording of audio input and output waveform data, which can be invaluable when troubleshooting echo,
feedback, or other audio processing problems.

[`Client::SetAecDump`] Enables or disables AEC diagnostic recording. When enabled, the input and output waveform data will be written to the
log directory (the same directory specified by [`Client::SetLogDir`]).

```cpp theme={"system"}
// Enable AEC diagnostic recording
client->SetAecDump(true);

// ... perform voice chat operations to reproduce the issue ...

// Disable AEC diagnostic recording when done
client->SetAecDump(false);
```

**When to use:**

* Users report echo or feedback during voice chat
* Audio quality issues that may be related to echo cancellation
* Testing AEC performance in different environments
* Debugging audio processing pipeline issues

<Warning>
  AEC dump files can become large quickly as they contain raw waveform data. Remember to disable the diagnostic recording
  once you've captured the necessary data for analysis.
</Warning>

## Client Tools

The Discord client now includes some built-in developer tools to help you diagnose issues and test some of the features of the Discord Social SDK. To enable these new tools, navigate to `Settings > Advanced` and toggle on Application Test Mode. For the purposes of this guide, enter your Application ID and ignore the rest of the options in this modal, then click Activate. Once you've enabled Application Test Mode, you should see a new wrench icon in the upper right corner of your client. Click on this to open the developer tools.

### Account Linking

This tab shows you the status of each of the on-platform account linking flows as well as provides a quick option to start the account linking flow without needing to find one of the entry points within the client. For more information on each of the flows, read the [Account Linking from Discord guide](/developers/discord-social-sdk/development-guides/account-linking-from-discord).

***

## Next Steps

<CardGroup>
  <Card title="Getting Started Guide" href="/developers/discord-social-sdk/getting-started">
    Learn how to get started with the Discord Social SDK.
  </Card>

  <Card title="Core Concepts" href="/developers/discord-social-sdk/core-concepts">
    Understand the core concepts of the Discord Social SDK.
  </Card>

  <Card title="Account Linking with Discord" href="/developers/discord-social-sdk/development-guides/account-linking-with-discord">
    Learn how to link user accounts with Discord.
  </Card>
</CardGroup>

Need help? Join the [Discord Developers Server](https://discord.gg/discord-developers) and share questions in the `#social-sdk-dev-help` channel for support from the community.

If you encounter a bug while working with the Social SDK, please report it here:  [https://dis.gd/social-sdk-bug-report](https://dis.gd/social-sdk-bug-report)

***

## Change Log

| Date              | Changes                   |
| ----------------- | ------------------------- |
| March 17, 2025    | initial release           |
| November 17, 2025 | add client tools          |
| May 4, 2026       | add voice logging section |

[`Client::AddLogCallback`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#af78996cff24a40f5dc7066beed16692c

[`Client::AddVoiceLogCallback`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#ac4f9b459f853ef7270d1bfc12509ede5

[`Client::SetAecDump`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a3a05b2cafaa546d915a5249c63f4059f

[`Client::SetLogDir`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a23bd5802dfa3072201ea864ee839c001

[`Client::SetVoiceLogDir`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a48c6b7e8bbc2b632a935acafc6a5f7a7
