Logging

This page explains how customers can leverage the option to log additional data from the mobile SDK for the purpose of performance monitoring, issue investigation and analytics

How it works

Firstly, there are two options available related to logging data:

  1. If you want to enable logging to the Keyless infrastructure use keylessLogsConfiguration . This options ensures Keyless has access to richer SDK logs to support investigations on our side, and also enriches the Keyless dashboard.

  2. Alternatively, if you wish to collect logging for you own analytics without sending them to the Keyless infrastructure use customLogsConfiguration

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

Collect logs after setting up custom logging with customLogsConfiguration option:

  1. Start collecting the Keyless.customLogs flow (This must happen before a Keyless.configure() to get all Logs Events):

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

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

Logging Levels

You may set different logging levels to provide more or less information in logs.

The available levels are the following:

  • INFO (default)

  • DEBUG

  • TRACE

The TRACE level provides the following additional data:

  • userId

  • devicePublicSigningKey

  • coreLogHistory (used for detailed debugging)

Last updated

Was this helpful?