> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/merchant-tokenization/es/integracion-del-sdk/error-management/retrieve-sdk-logs/ios.md).

# iOS

## Registros seguros <a href="#secure-logs-1" id="secure-logs-1"></a>

Configure el SDK de Thales para generar archivos de registro seguros y ofuscados.

### Habilitar o deshabilitar el registro seguro <a href="#how-to-enabledisable-secure-logging" id="how-to-enabledisable-secure-logging"></a>

El registro seguro está habilitado por defecto. Puede desactivarlo durante la inicialización del SDK de Thales:

```swift
let serverUrl;
let serverCertificate;
let keyIdentifier;
let enableSecureLog; //Opcional
let configurationBuilder = TMGClientConfiguration.Builder(serverUrl: serverUrl, 
                                                          serverCertificate: Data(serverCertificate.utf8), 
                                                          serverKeyId: keyIdentifier,
                                                          enableSecureLog: false)
```

En este ejemplo, `enableSecureLog` está establecido en `false`. Esto desactiva la generación de registros después de que se inicializa el SDK de Thales. Con la configuración predeterminada (`true`), el SDK escribe registros durante la vida del proceso de la aplicación.

También puede pausar el registro temporalmente:

```swift
// deshabilitar registros temporalmente.
TMGClient.secureLog?.setLevel(.off)
 
// reanudar el registro con el nivel de registro predeterminado.
TMGClient.secureLog?.setLevel(.warn)
```

Establecer el nivel de registro en `.off` impide que el SDK de Thales escriba nuevas entradas de registro seguro. Vuélvalo a poner en `.warn` (predeterminado) u otro nivel para reanudar el registro.

### Recuperar archivos de registro seguros <a href="#how-to-retrieve-secure-log-files-1" id="how-to-retrieve-secure-log-files-1"></a>

El SDK de Thales genera archivos de registro seguros en el sandbox de la aplicación. Recupérelos así:

```swift
if let logFiles: [URL] = TMGClient.secureLog?.files() {
    // procesar los archivos     
}
```

`logFiles` contiene una matriz de `URL` objetos para los archivos de registro disponibles. Comparta estos archivos con el equipo de entrega de Thales al investigar un problema.

## Registros de la consola <a href="#console" id="console"></a>

Vea los registros en la consola usando la `debug` biblioteca:

1. Abra la aplicación Consola en su Mac.
2. En la Consola **Acción** menú, habilite tanto `Incluir mensajes de información` y `Incluir mensajes de depuración`.

{% hint style="info" %}
Para ver los registros en `Console.app`, filtre por `TMGSDK` en el **campo** .
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.payments.thalescloud.io/merchant-tokenization/es/integracion-del-sdk/error-management/retrieve-sdk-logs/ios.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
