Skip to content

Getting logs from mobile devices#

LUNA ID writes service information to the logging system of the corresponding platform - Android and iOS. You can use this information diagnose and debug both the user application that uses LUNA ID and to debug and fix LUNA ID.

A common problem that requires getting logs is related to the image that LUNA ID takes as input. Before you start collecting logs, make sure that the image meets the requirements and the thresholds are correctly configured to pass the OneShotLiveness estimation. For more information on image requirements and thresholds, see About OneShotLiveness estimation.

Data to be provided to VisionLabs Technical support#

Along with the collected logs, provide the following data to Technical Support:

  • Device model on which the issue was detected
  • MUI
  • OS version
  • LUNA ID version
  • Detailed playback steps
  • Video recording of the issue

Prerequisites#

To successfully receive logs from mobile devices, the following prerequisites must be met:

  • Make sure that the necessary values for FaceEngine and TrackEngine logging are set in the configuration files. For details on the required values and configuration files, see the FaceEngine and TrackEngine logging section.
  • Before collecting logs, uninstall the app for which you are going to collect logs, and then reinstall it. Start collecting logs after the first launch of the app.
  • The log file should contain entries from the moment the app was started until the problem occurred.
  • Put the mobile device in developer or debug mode.

FaceEngine and TrackEngine logging#

For detailed logging of FaceEngine and TrackEngine, the following values must be set in configuration files:

File Value
Faceengine.conf <param name=”verboseLogging” type=”Value::Int1” x=«4» />
runtime.conf <param name=”verboseLogging” type=”Value::Int1” x=«4» />
trackengine.conf <param name=”mode” type=”Value::String” text=”l2b” />
<param name=”severity” type=”Value::Int1” x=”0” />

Getting logs from Android devices#

There are several ways to get logs from Android devices. To do this, we recommend that you use the Logcat window in Android Studio.

To get logs from an Android device:

1․ Put your mobile device in developer mode:

Depending on the manufacturer of the Android device, the instruction may vary slightly.

1.1 In settings, select About phone or About tablet.

1.2 Find the Build Number or Android Version section and repeatedly tap it.

1.3 Confirm the transition of the device to developer mode.

1.4 Go to Settings > System > For Developers.

1.5 Set the USB Debugging switch to on.

1.6 Allow USB debugging.

2․ In Android Studio, open the Logcat tab. To do this, select View > Tool Windows > Logcat from the Android Studio menu.

3․ In the upper-left corner, select the device from which you want to receive logs.

4․ In the next field, select the logs of the required app. If you want to get logs of all apps, do not change this field.

5․ Select the logging level VERBOSE.
With the VERBOSE logging level, you can see records from all previous levels and get the most useful information.

6․ In the search box, enter the required information to filter the results. For example, you can include a package name, a part like fatal, and so on.

Android Studio Logcat

7․ Configure the display of logs:

7․1 Go to Logcat tab settings.

7․2 Select Logcat Header, check the following boxes and click OK:

  • Show date and time (required)
  • Show process and thread IDs
  • Show package name
  • Show tag

Configuting the display of logs

The resulting logs contain the following data:

  • Date and time of entry.
  • Logging level (for example, D is Debug).
  • The name of the tool, utility, package from which the message is received, as well as a decoding of the ongoing action.

Android device logs

Getting logs from iOS devices#

The main tool for getting logs from iOS devices is XCode. Xcode is a software development environment for macOS and iOS platforms.

To get logs from an iOS device:

1․ Put your mobile device in developer mode:

1․1 Go to Settings > Privacy and Security.

1․2 Find the Developer Mode section and activate the option.

1․3 Restart your device.

2․ Connect your iOS device to your Mac.

3․ From the Xcode menu, select the menu item Window > Devices and Simulators.

Devices and Simulators

4․ Select the connected device.

5․ Click the View Device Logs button. If you want to view the logs in real time, click the Open Console button.

View Device Logs

6․ In the search box, enter the required information to filter the results.

7․ Find the needed log file and copy it to a text file.

Logs for iOS device

Tip: To pause the log stream, click the Pause button.

The resulting logs contain the following data:

  • Date and time of entry.
  • The name of the part of the system or application from which the message came.
  • Event description, service information.

iOS device logs

Getting logs for OneShotLiveness estimation from Android devices#

If OneShotLiveness is enabled, you can find the corresponding data in logs.

Here is an example of logs for LUNA ID sending a request for OneShotLiveness estimation when getting the best shot:

 I  --> POST https://luna-api-aws.visionlabs.ru/6/liveness?aggregate=1
 D  Deallocating scratch [101632 bytes]
 I  Content-Type: multipart/form-data; boundary=d9fb08cd-a74a-4d22-b596-c9d1810c7470
 I  Content-Length: 2510479
 I  Luna-Account-Id: 12ed7399-xxxx-xxxx-xxxx-bbc45e6017af
 I  --> END POST (binary 2510479-byte body omitted)

The response returns the following status codes:

  • Status code 200
    If the request has reached the server and the server was able to process it, it returns status code 200. For example:
    I <-- 200 https://luna-api-aws.visionlabs.ru/6/liveness?aggregate=1 (5895ms) I server: nginx/1.19.2 I date: Tue, 08 Aug 2023 23:30:51 GMT I content-type: application/json I vary: Accept-Encoding I luna-request-id: 1691548250,d70bca42-b40c-4c69-ae71-c3ce8207d3d3 I strict-transport-security: max-age=15724800; includeSubDomains I access-control-allow-origin: * I access-control-allow-credentials: true I access-control-allow-methods: GET, PUT, POST, DELETE, PATCH, OPTIONS I access-control-allow-headers: Authorization,Cache-Control,Content-Type,luna-account-id I {"images":[{"filename":"0","status":1,"liveness":{"prediction":1,"estimations":{"probability":0.9960508346557617,"quality":1.0}},"error":{"error_code":0,"desc":"Success","detail":"Success","link":"https:\/\/docs.visionlabs.ai\/info\/luna\/troubleshooting\/errors-description\/code-0"}}],"aggregate_estimations":{"liveness":{"prediction":1,"estimations":{"probability":0.9960508346557617,"quality":1.0}}}} I <-- END HTTP (404-byte body)
  • Status code other than 200
    For details on status codes other than 200, please refer to the LUNA PLATFORM API documentation.

Getting logs for OneShotLiveness estimation from iOS devices#

Currently, you cannot collect logs for OneShotLiveness estimation by using iOS features.