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

# Configure log level

> Control the verbosity of SDK log output at runtime using PortalLogLevel.

By default, the Portal SDK emits no logs. You can enable logging at any verbosity level to help debug integration issues or monitor SDK behavior in development.

## Log levels

The `PortalLogLevel` enum defines five levels. Each level includes all levels above it in severity.

| Level                  | What is logged                                                                          |
| ---------------------- | --------------------------------------------------------------------------------------- |
| `PortalLogLevel.NONE`  | Nothing. This is the default.                                                           |
| `PortalLogLevel.ERROR` | Failures only — failed transactions, network errors, binary crashes.                    |
| `PortalLogLevel.WARN`  | Unexpected but non-fatal conditions — deprecated usage, retries, slow responses.        |
| `PortalLogLevel.INFO`  | Normal operational milestones — signing started, share generated, connection opened.    |
| `PortalLogLevel.DEBUG` | Everything, including internals — request/response payloads, timing, state transitions. |

## Set the log level

Call `portal.setLogLevel()` after initializing your `Portal` instance. The change takes effect immediately across all SDK components.

```kotlin theme={null}
import io.portalhq.android.Portal
import io.portalhq.android.utils.PortalLogLevel

class MainActivity : AppCompatActivity() {
    lateinit var portal: Portal

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        portal = Portal("YOUR_CLIENT_API_KEY")

        // Enable debug logging during development
        portal.setLogLevel(PortalLogLevel.DEBUG)
    }
}
```

<Note>
  Set the log level before calling any other SDK methods to capture all output from the start.
</Note>

## Recommended levels by environment

* **Development**: `PortalLogLevel.DEBUG` — see all SDK activity while building your integration.
* **QA / staging**: `PortalLogLevel.INFO` or `PortalLogLevel.WARN` — surface operational milestones and anomalies without noise.
* **Production**: `PortalLogLevel.NONE` (default) — no logs emitted. Use `PortalLogLevel.ERROR` if you want to forward failures to a crash reporter.

<Warning>
  Do not use `PortalLogLevel.DEBUG` in production. Debug output includes request payloads and internal state that may contain sensitive data.
</Warning>

## Log output

Logs are written to Android's standard logging system and appear in Logcat. You can filter them in Android Studio's Logcat window or via `adb logcat` by searching for the `PortalSDK` tag:

```
tag:PortalSDK
```
