PingOne Recognize

Logging

Logging is disabled by default.
Logs do not include any Personally Identifiable Information (PII).

How It Works

There are two options for logging:

  1. To enable logging to PingOne Recognize infrastructure, use keylessLogsConfiguration. This gives PingOne Recognize richer SDK logs for investigation and enriches the PingOne Recognize dashboard.

  2. To collect logs only for your analytics (without sending to PingOne Recognize infrastructure), use customLogsConfiguration.

Android

val setup = SetupConfig(
    apiKey = "...",
    hosts = listOf(""),
    keylessLogsConfiguration = LogsConfiguration(
        enabled = true,
        logLevel = LogLevels.INFO
    ),
    customLogsConfiguration = LogsConfiguration(
        enabled = true
    )
)

iOS

let configuration = SetupConfig(
    apiKey: "some api key",
    hosts: ["some.host"],
    keylessLogsConfiguration: KeylessLogsConfiguration(enabled: true),
    customLogsConfiguration: CustomLogsConfiguration(enabled: true, logLevel: .INFO, callback: { event in
        print(event)
    })
)

Keyless.configure(setupConfiguration: configuration) { error in
    // handle error
}

Android 4.6

val setupConfiguration = SetupConfiguration.builder
    .withApiKey("")
    .withHosts(listOf("..."))
    .withLogging(
        keylessLogsConfiguration = LogsConfiguration(enabled = true),
        customLogsConfiguration = LogsConfiguration(enabled = true, logLevel = LogLevels.INFO)
    )
    .build()

iOS 4.6

let configuration = Keyless.SetupConfiguration
  .builder
  .withApiKey("some api key")
  .withHosts(["some.host"])
  .withLogging(
    keylessLogsConfiguration: KeylessLogsConfiguration(enabled: true, logLevel: .INFO),
    customLogsConfiguration: CustomLogsConfiguration(enabled: true, callback: { event in
      print(event)
    })
  )
  .build()

Keyless.configure(setupConfiguration: configuration) { error in
  // handle error
}

Flutter

final configuration = SetupConfiguration(
  apiKey: apiKey,
  hosts: [host],
  loggingEnabled: true,
  loggingLevel: LogLevel.info,
);

try {
  final result = await Keyless.instance.configure(configuration);
  print("Configure finished successfully.");
} catch (error) {
  print("Configure finished with error: $error");
}

React Native

const config = new SetupConfig({
  apiKey: 'apiKey',
  hosts: ['HOSTS'],
  keylessLogsConfiguration: new LogsConfiguration({
    enabled: true,
    logLevel: LogLevels.INFO,
  }),
  customLogsConfiguration: new LogsConfiguration({
    enabled: true,
    logLevel: LogLevels.TRACE,
  }),
});

const result = await Keyless.configure(config);

result.fold({
  onSuccess: _data => {
    // Handle success
  },
  onFailure: _error => {
    // Handle error
  },
});

Collect Custom Logs

Collect logs after enabling customLogsConfiguration:

Android

  1. Start collecting Keyless.customLogs (this must happen before Keyless.configure() to get all log events):

    Keyless.customLogs.collect { logEvent ->
        // handle logEvent
    }
  2. Configure SDK with SetupConfig:

    val setup = SetupConfig(
        apiKey = "...",
        hosts = listOf(""),
        customLogsConfiguration = LogsConfiguration(
            enabled = true,
            logLevel = LogLevels.INFO // optional, defaults to INFO
        )
    )

iOS

var myEventCollection = [LogEvent]()
let configuration = Keyless.SetupConfiguration
  .builder
  .withApiKey("some api key")
  .withHosts(["some.host"])
  .withLogging(
    keylessLogsConfiguration: KeylessLogsConfiguration(enabled: true, logLevel: .INFO),
    customLogsConfiguration: CustomLogsConfiguration(enabled: true, callback: { event in
      myEventCollection.append(event)
    })
  )
  .build()

Keyless.configure(setupConfiguration: configuration) { error in
  // handle error
}

React Native

  1. Start collecting PingOne Recognize custom logs (this must happen before Keyless.configure() to get all log events):

    const eventSubscription = Keyless.subscribeToCustomLogs(eventLog => {
        // Handle log
    });
    
    const config = new SetupConfig({
      apiKey: 'apiKey',
      hosts: ['HOSTS'],
      customLogsConfiguration: new LogsConfiguration({
        enabled: true,
        logLevel: LogLevels.TRACE,
      }),
    });
    
    const result = await Keyless.configure(config);
    
    result.fold({
      onSuccess: _data => {
        // Handle success
      },
      onFailure: _error => {
        // Handle error
      },
    });
  2. When you want to unsubscribe from logs, call:

    eventSubscription?.unsubscribe();

Logging Levels

You can set different logging levels for more or less detail:

  • INFO (default)

  • DEBUG

  • TRACE

TRACE provides additional data:

  • userId

  • devicePublicSigningKey

  • coreLogHistory (used for detailed debugging)