ForgeRock SDKs

Troubleshooting

This section contains information on how to diagnose issues within the application, or with communication to the ForgeRock Identity Platform.

Enable debug logging

The basic Swift error handling is generic and may not provide enough information for you to troubleshoot the SDK. The FRAuth package provides extensive logging for debugging purposes.

To enable logging, add FRLog.setLogLevel to your ViewController class.

For example:

//
//  ViewController.swift
//  DemoApp
//

import UIKit
import FRAuth

class ViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.

        FRLog.setLogLevel(.all)

        do {
            try FRAuth.start()
            print("SDK initialized successfully")
        }
        catch {
            print(error)
        }
    }
}

When you have enabled debug logging, the output provides extensive information to help you troubleshoot the SDK.

To disable logging, set:

FRLog.setLogLevel(.none)

The following log levels are supported:

Level Usage

none

No debug log at all

verbose

Highly detailed log

info

Useful information log

network

Network requests / response logs

warning

Non-critical error that does not impact flow or functionality of the SDK

error

Critical error that does impact flow or functionality of the SDK

all

All log levels

Copyright © 2010-2023 ForgeRock, all rights reserved.