Display Logs for the Java Client
You can control the log levels for the Java client in the logging.properties file on your operating system. For example, for Java 7 (required) on Mac OS X, this file is located in: $JAVA_HOME/jre/lib/logging.properties.
For more information, see Java Logging Overview. Ensure that you have write permissions to this file.
Before You Begin
This procedure is part of Checklist: Build Java Clients Using Kaazing WebSocket Gateway:
- Set Up Your Development Environment
- Interact with Kaazing WebSocket Gateway Using the WebSocket API
- Interact with Kaazing WebSocket Gateway Using the EventSource API
- Migrate WebSocket and ByteSocket Applications to Kaazing WebSocket Gateway 4.x
- Secure Your Java and Android Clients
- Display Logs for the Java Client
- Troubleshoot Your Java Client
Note: Learn about supported browsers, operating systems, and platform versions in the Release Notes.
To Enable the Java Client Logs
- Build your Java client, as described in Checklist: Build Java Clients Using Kaazing WebSocket Gateway.
- Add the following line to the logging.properties file to display the complete log output:
com.kaazing.gateway.client.level = ALL
Note: The Java Logging API has a default logging configuration file located inside the JRE directory at JRE_DIRECTORY/lib/logging.properties. For example, on a Mac: /System/Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home/jre/lib/logging.properties.
Configure the ConsoleLogHandler to display all messages by changing the line:
java.util.logging.ConsoleHandler.level = INFO
to
java.util.logging.ConsoleHandler.level = ALL
- Save the logging.properties file.
- Enable logging in the Java Console or Java Preferences. To do so:
- In Windows, in the Java Control Panel, on the Advanced tab, choose Java console, then select Show console.
- On Mac OS X, for Java 7 (required), access the Java system preference in System Preferences, click Advanced, and under Debugging, click Enable logging. Then, under Java console, select Show console.
- Start the Gateway as described in Setting Up Kaazing WebSocket Gateway.
- Restart the browser and use the out of the box Java Echo Demo.
- In a browser, navigate to the out of the box demos at http://localhost:8001/demo/, click Java and follow the instructions. The Java Console will open and display all logs from the Java Client.
Notes
If you are using Microsoft Internet Explorer 8, you may need to restart the browser as an administrator to view the logs from the Java Client.
Next Step
See Also
You have completed the Java client howtos. For more information on client API development, see the Java Client API.