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#
This guide outlines the process of getting logs from Android devices using Android Studio's Logcat tool.
Step 1: Enable developer options & USB debugging#
- On your Android device, open Settings.
- Navigate to About phone or About tablet.
- Locate the Build Number or Android Version section and tap it 7 times repeatedly.
- Confirm the transition of the device to developer mode.
- Go to Settings > System > For Developers.
- Set the USB Debugging switch to on.
- Allow USB debugging.
Note: The exact path to these settings may vary slightly depending on your device manufacturer and Android version.
Step 2: Open Logcat in Android Studio#
- Connect your Android device to your computer via USB.
- Open Android Studio.
- Select View > Tool Windows > Logcat from the Android Studio menu.
Step 3: Select device and configure Logcat#
In the Logcat window, configure the following filters and settings:
- Device: In the upper-left corner, select the connected device.
- App/Process: In the adjacent field, select the app you want to monitor. To see logs from all processes, do not change this field.
- Log level: Set the logging level to VERBOSE. This ensures you capture log messages from all levels.
Step 4: Configure the Logcat layout#
To make the logs more readable and informative, enable the following headers:
- Go to the Logcat tab settings.
- Select Logcat Header.
- Select the following options and click OK in the appeared dialog:
- Show date and time (required)
- Show process and thread IDs
- Show package name
- Show tag
Step 5: Filter the logs#
Use the search bar to narrow down the log output. For example, you can:
- Search by a package name:
com.example.app - Search by a log tag:
tag:LunaID: Shows all LUNA ID logs.tag:LunaID level:info: Shows onlyinfologs containing key operational data, results, warnings, and errors.tag:LunaID is:debug: Shows onlydebuglog containing low-level, internal information for debugging.
- Search for specific keywords or error levels:
fatal,E/AndroidRuntime
Understanding the log output#
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.
Getting logs from iOS devices#
This guide outlines the process of getting logs from Android devices using Xcode's built-in console tools.
Step 1: Enable developer mode#
- Open Settings on your iOS device.
- Navigate to Privacy & Security.
- Toggle the Developer Mode switch on.
- Restart your device.
Step 2: Access device logs in Xcode#
- Connect your iOS device to your Mac.
- Open Xcode.
- Select Window > Devices and Simulators.
- Select the connected device.
Step 3: View and capture logs#
You have two option for viewing logs:
- To analyzing historical logs, click the View Device Logs button.
- To monitor logs in real-time, click the Open Console button.
Step 4: Filter and export logs#
For filtering, use the search bar in either thr Device Logs viewer or the Console app to narrow down results.
For exporting, select specific log entries and copy them to a text file.
Tip: To pause the log stream, click the Pause button.
Understanding the log output#
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.
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 code200. 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 than200, 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.