Display Logs for the Android Client
You can log the messages sent and received by your Android client, as well as connection information, using the tools built into Android Studio.
Before You Begin
This procedure is part of Checklist: Build Android Clients Using Kaazing Gateway:
- Use the Kaazing Gateway Android Client API
- Secure Your Java and Android Clients
- Display Logs for the Android Client
Note: Learn about supported browsers, operating systems, and platform versions in the Release Notes.
To Enable Android Client Logging
- Build your Android client as described in Use the Kaazing Gateway Android Client API.
- In the Android Studio project for your Android JMS client, import the java.util.logging classes:
import java.util.logging.Level; import java.util.logging.Logger;
- Import the Android JMS Client API Tracer utility:
import com.kaazing.gateway.jms.client.util.Tracer;
- In the onCreate() method of your Android JMS client, add the following statements.
Tracer.DEBUG = true; Logger logger = Logger.getLogger("com.kaazing.ws.client"); logger.setLevel(Level.FINE)
- Save your project.
- Follow the steps in the Android Studio documentation to use Logcat:
See Also
You have completed the Android client checklist. For more information about the Kaazing Gateway Android Client API, see Kaazing Gateway Android Client API.