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

# Logging

> Debug logging for the Rive React Native runtime

This Rive runtime includes logging capabilities to help with debugging. These logs are *only* for debugging purposes; nothing is sent over the network, and no personally identifiable information (PII) is logged.

The table below showcases the runtimes that support logging.

> [!NOTE]
>
> This page only applies to the [new
> runtime](https://github.com/rive-app/rive-nitro-react-native), `@rive-app/react-native` 0.5.0 or later.

By default, Rive logs to Logcat on Android and to React Native's `RCTLog` on iOS. Nothing reaches JavaScript until you call `RiveLog.forwardToConsole()` or `RiveLog.setHandler()`.

On iOS, errors are logged with `RCTLogError`, so debug builds also show them as a red error screen. Forwarding logs to the console or setting a handler avoids this.

## Forwarding logs to the console

```ts theme={null}
import { RiveLog } from '@rive-app/react-native';

RiveLog.forwardToConsole();
```

Messages start with `[Rive/<tag>]`. Debug and info logs use `console.log`. Warnings and errors both use `console.warn`, so they don't show the red error screen in debug builds. Errors you can handle reach your app through `onError` and rejected promises. See [Error handling](https://rive.app/docs/runtimes/react-native/error-handling.md).

## Setting the logging level

Logs below the level you set are dropped everywhere. The default is `warn`.

```ts theme={null}
RiveLog.setLogLevel('debug'); // 'debug' | 'info' | 'warn' | 'error'
```

## Using a custom logger

```ts theme={null}
RiveLog.setHandler((level, tag, message) => {
  myLogger.log(level, `[Rive/${tag}] ${message}`);
});
```

Only one handler is active at a time, so `setHandler` and `forwardToConsole` replace each other. Tags differ between iOS and Android, so don't match on specific tags.

## Returning to the default

Call `RiveLog.resetHandler()` to remove the current handler and log to Logcat and `RCTLog` again.
