The **logger** logs information about your experiments to help you with debugging. You can customize where log information is sent and what kind of information is tracked.
The React Native SDK comes with a default [`Logger
` implementation](🔗). To configure the log level threshold, you can call `setLogLevel
`.
To turn off logging from the SDK, call `setLogger
` with `null
`:
For finer control over your SDK configuration in a production environment, pass in a custom logger for your Optimizely client. A custom logger is a function that takes an argument, the level, and the message. See the code example below to create and set a custom logger.
## Log levels
The table below lists the log levels for the JavaScript (React) SDK.
Log Level | Explanation |
**ERROR** | Events that prevent feature flags from functioning correctly (for example, invalid datafile in initialization and invalid feature keys) are logged. The user can take action to correct. |
**WARNING** | Events that don't prevent feature flags from functioning correctly, but can have unexpected outcomes (for example, future API deprecation, logger or error handler are not set properly) are logged. |
**INFO** | Events of significance (for example, activate started, activate succeeded, tracking started, and tracking succeeded) are logged. This is helpful in showing the lifecycle of an API call. |
**DEBUG** | Any information related to errors that can help us debug the issue (for example, the feature flag is not running, user is not included in the rollout) are logged. |