Display Logs for the Flash Client
The Kaazing ActionScript and Flex/Flash code uses Flex Logging to log messages.
Before You Begin
This procedure is part of Checklist: Build Flash 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
- Secure Your Flash Client
- Display Logs for the Flash Client
- Troubleshoot Your Flash Client
Note: Learn about supported browsers, operating systems, and platform versions in the Release Notes.
To Enable Flash Client Log Messages
- Build your Kaazing Flash client, as described in Checklist: Build Flash Clients Using Kaazing WebSocket Gateway.
- Download and install the debug version of the Flash Player plug-in. For more information on using this, see Adobe's online help on using the debugger version of Flash Player.
- Create the mm.cfg file for the Flash Player. For information where to save this file for your operating system, see Adobe's online help on creating the mm.cfg file.
- In the mm.cfg file, add the following lines to enable tracing:
TraceOutPutFileName=/Users/<username>/Library/Preferences/Macromedia/Flash Player/Logs/flashlog.txt ErrorReportingEnable=1 MaxWarnings=0 TraceOutputFileEnable=1
The TraceOutPutFileName parameter specifies where the log file will be created automatically (this example uses a Linux file directory). The username value represents the current user's home folder.
- Configure the log level for the various Kaazing classes in the client code. For example, the out of the box Flash & Flex WebSocket Echo demo, (which you can view by following the steps in Setting Up Kaazing WebSocket Gateway) includes an example of this configuration, as shown here:
private function initLogging():void { // Create a target. var logTarget:TraceTarget = new TraceTarget(); // Log only messages for the classes in Kaazing packages logTarget.filters=["com.kaazing.gateway.client.*"]; // Log all log levels. logTarget.level = LogEventLevel.ALL; // Add date, time, category, and log level to the output. logTarget.includeDate = true; logTarget.includeTime = true; logTarget.includeCategory = true; logTarget.includeLevel = true; // Begin logging. Log.addTarget(logTarget); }
- Save your changes then start (or restart) your browser.
- Visit the page containing the Flash applet. Log messages should display in the log file, for example in /Users/username/Library/Preferences/Macromedia/Flash Player/Logs/flashlog.txt. For information on locating your local log file, visit Adobe's online help on the log file location.
Notes:
- If you run the Flash client in Google Chrome using its integrated Flash plugin, no logging will occur, even if you have installed the debug version of the Adobe Flash player. To fix this configuration in Chrome, open the Chrome plugin settings (chrome://plugins/), disable the Chrome Flash Player, and then enable the Adobe Flash Player.