# Analyze SDK Logs

When encountering complex transaction or connectivity issues, SDK logs provide detailed diagnostic information about Bluetooth communication, gateway interactions, and transaction processing. This guide explains how to enable logging, access log data, and extract logs for troubleshooting or Get Mini technical support.

## Requirements

Before extracting SDK logs, ensure you have Xcode installed on your Mac for device management and log extraction. You'll need the physical iOS device that experienced the issue connected to your development Mac. For field issues occurring on customer devices, you'll need device access or the ability to download app containers through enterprise deployment tools.

## Step 1: Enable SDK Logging

Activate verbose logging during SDK configuration to capture detailed diagnostic information. Enable logging before initializing the SDK manager:

```
let config = TPVVConfiguration()
config.fuc = "999008881"
config.terminal = "001"
config.environment = .test
config.logEnabled = true  // Enable detailed logging

TPVVConfiguration.shared = config
```

With logging enabled, the SDK captures detailed information about Bluetooth discovery and connection processes, card reading and PIN entry operations, authorization requests and responses, error conditions and exception details, and timing information for performance analysis.

<Callout type="warning">

Disable logging in production builds to avoid performance overhead and prevent sensitive data from being written to logs. Only enable logging during development and troubleshooting.

</Callout>

## Step 2: View Real-Time Logs in Xcode

When debugging with a device connected to Xcode, view SDK logs in real-time through the Xcode debug console. Run your application with the device connected, and open the debug area using Command+Shift+C or through View > Debug Area > Show Debug Area.

SDK log messages appear tagged with `[GetMiniSDK]` prefixes for easy filtering. Use the Xcode console's search functionality to filter for specific log types or keywords. Look for error messages, transaction identifiers, and timing information relevant to your issue.

Real-time logging helps diagnose issues during development and controlled testing scenarios where devices remain connected to development machines.

## Step 3: Extract Logs from Device

For issues occurring in the field or when real-time debugging isn't available, extract log files from the application's sandbox for offline analysis. Connect the affected iOS device to your Mac running Xcode and follow these steps:

Open Xcode and navigate to Window > Devices and Simulators from the menu bar. Select your connected iOS device from the left sidebar, then locate your application in the Installed Apps list. Click the gear icon next to your app and select "Download Container..." from the dropdown menu. Xcode downloads and saves the app container as an `.xcappdata` file.

Locate the downloaded container file in Finder, right-click it, and select "Show Package Contents" to access the container's internal structure. Navigate to `AppData/Library/Caches/GetMiniLogs/` within the package to find SDK log files. Log files are typically named with timestamps or session identifiers for organization.

Copy the relevant log files to a location outside the container package for analysis or submission to support. The container package can be discarded after extracting needed log files.

## Providing Logs to Technical Support

When opening support tickets with Get Mini technical support, include comprehensive diagnostic information to expedite issue resolution. Attach the extracted log files from the steps above, ensuring you provide logs covering the timeframe when the issue occurred. Include the order ID or transaction reference for failed or problematic transactions if available. Provide the PIN pad reader's serial number found on a label on the device's back or bottom.

Additionally, document the steps to reproduce the issue, including transaction amounts, timing, and specific actions taken. Note the iOS version, device model, and SDK version used in your application. Include any error messages displayed to users or logged in your application's own logs.

The more context you provide along with SDK logs, the faster support teams can diagnose and resolve issues.

## Log Analysis Best Practices

When analyzing SDK logs yourself, look for specific patterns that indicate common issues. Search for "Error" or "Exception" keywords to identify failure points. Check authorization response codes in gateway communication logs. Verify Bluetooth connection states show successful pairing before transaction attempts. Review timing information to identify performance bottlenecks or timeout conditions.

Compare logs from successful transactions against failed transactions to identify differences in communication patterns or response codes. Pay attention to the sequence of operations—some issues arise from incorrect call ordering or missing initialization steps.

## Log Security Considerations

SDK logs may contain sensitive transaction information including partial card data (masked), authorization codes, and merchant identifiers. Treat log files as confidential data requiring protection. Never share logs publicly or through unsecured channels. When submitting logs to support, use secure file transfer methods provided by Get Mini. Delete log files from temporary locations after analysis completes.

For production applications, implement log rotation to prevent logs from consuming excessive device storage. Consider encrypting log files if they remain on devices for extended periods.

## Next Steps

* [Debug Bluetooth Connectivity](/en/get-mini/ios-sdk/guides/debug-bluetooth) - Troubleshoot connectivity issues
* [Use the Test Environment](/en/get-mini/ios-sdk/guides/use-test-environment) - Configure testing setup
* [Initialize the SDK](/en/get-mini/ios-sdk/guides/initialize-ios-sdk) - SDK configuration guide