> ## 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

### At initialization

Pass `logLevel` when initializing your `Portal` instance.

```dart theme={null}
import 'package:portal_flutter/portal_flutter.dart';

final portal = Portal();

await portal.initialize(
  apiKey: 'YOUR_CLIENT_API_KEY',
  logLevel: PortalLogLevel.debug,
);
```

### At runtime

Call `portal.setLogLevel()` at any time. The change takes effect immediately across all SDK components — no reinitialization needed.

```dart theme={null}
// Enable debug logging during development
await portal.setLogLevel(PortalLogLevel.debug);

// Later, reduce to errors only
await portal.setLogLevel(PortalLogLevel.error);
```

<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>

**Related Documentation**

* [setLogLevel reference](../reference/setloglevel)
