Display Logs for the Android JMS Client
You can log the messages sent and received by your client, as well as connection information, using the java.util.logging.Logger and java.util.logging.Level classes and the LogCat console in Android Studio (available by pressing Alt+6).
Before You Begin
This procedure is part of Checklist: How to Build Android JMS Clients.
Note: Learn about supported browsers, operating systems, and platform versions in the Release Notes.
To Enable Android JMS Client Logging
- Build your Android JMS client as described in Use the Kaazing Gateway Android JMS 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.gateway.jms.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 JMS Client checklist. For more information about the Kaazing Gateway Android JMS Client API, see Kaazing Gateway Android JMS Client API.