Welcome to our new developer portal! Use the "Ask" button to chat with our AI Agent.
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Collect logs with LogService

Overview

The NFC Wallet SDK collects runtime logs and stores them in the application sandbox.

Your digital wallet application can retrieve log files and share them with Thales for troubleshooting.

Starting with NFC Wallet SDK 6.14.0, logging is enabled automatically with the default configuration.

SDK integration

Get the log service

Retrieve the LogService instance:

LogService logService = SDKInitializer.getLogService(context);

The SDK applies the default configuration automatically during SDK initialization.

// Before 6.14.0
SecureLog secureLog = SDKInitializer.INSTANCE.configureSecureLog(
        new SecureLogConfig.Builder(context)
                .build()
);

secureLog.setLevel(SecureLogLevel.INFO);
List<File> files = secureLog.getFiles();
secureLog.deleteFiles();

// Since 6.14.0
LogService logService = SDKInitializer.getLogService(context);

logService.setLevel(LogService.Level.INFO);
List<File> files = logService.getFiles();
logService.deleteFiles();

Change log level

Use setLevel(...) to change the log level. The default log level is Level.WARN.

Set the level to OFF to stop writing new log entries.

Log levels

Use the lowest level that supports your use case.

Level
Numeric value
Use

ALL

7

Capture all log entries. Equivalent to DEBUG.

DEBUG

7

Capture detailed logs for troubleshooting. Use temporarily only.

INFO

6

Capture routine operational logs.

ERROR

3

Capture runtime errors that require investigation.

WARN

4

Capture warnings. This is the default level.

FATAL

2

Capture unrecoverable runtime errors only.

OFF

0

Disable logging.

Use DEBUG only for short troubleshooting sessions.

For normal operation, keep the default level WARN.

Disable logging

Starting with NFC Wallet SDK 6.14.0, logging is enabled by default.

Set the level to OFF to disable it:

Retrieve log files

After you retrieve the LogService instance, call getFiles():

Call deleteFiles() to delete the log files:

Full example

This example retrieves the log service instance, zips all log files, and shares them using an Android share sheet.

Migrate from secure logger API

Remove the deprecated configuration code.

Then retrieve the LogService instance when you need it.

Deprecated API
Replacement

SDKInitializer.INSTANCE.configureSecureLog(SecureLogConfig)

SDKInitializer.getLogService(Context)

SecureLogConfig.Builder(...)

No replacement. The SDK uses the default configuration.

secureLog.setLevel(SecureLogLevel.X)

logService.setLevel(LogService.Level.X)

secureLog.getFiles()

logService.getFiles()

secureLog.deleteFiles()

logService.deleteFiles()

Last updated

Was this helpful?