FusionCharts for Flex > Creating Widgets > Real-Time Capabilities > Message Logger > Setting it Up

To use message logger, first make sure that you're using a real-time gauge from FusionWidgets suite - i.e., gauges, which upate themselves in real-time. Examples are real-time angular gauge, linear gauge, cylinder, thermometer, bulb, LED etc.

Thereafter, there are 2 steps involved in configuring and using the message logger:

  1. Configure your XML data document to use message logger. Also, set up the XML attributes to configure the functional and cosmetic properties of the message logger.
  2. Configure your real-time data provider page to broadcast/stream messages to the logger.

We'll discuss both of these steps in details.

 
Setting up the message logger - XML Attributes

To use the message logger in a real time gauge, you just need to set the following in your XML:

<chart useMessageLog='1' ..>

This attribute tells the gauge to setup message logger and listen to messages streamed from the server.

Note that the message logger becomes visible only when it listens to the first message streamed from the server. By default, it stays in a hidden mode.

So, when you first set the message logger on for a real-time angular gauge, you would get a screen as shown below:

And, when the first message is streamed to the gauge from server, the logger will be displayed as shown below:
 
Configuring the logger

The following <chart> element attributes help you configure the functional and cosmetic properties of the message logger.

Attribute Name Type Description
messageLogWPercent Number (0-100) This attribute lets you set the width percent of the message logger window w.r.t entire gauge width. So, if you set it as 80, the message logger window will take up 80% of gauge width.
messageLogHPercent Number (0-100) This attribute lets you set the height percent of the message logger window w.r.t entire gauge height.
messageLogShowTitle Boolean (0/1) Whether to show the title for message logger?
messageLogTitle String If you've opted to show the title for message logger, you can define your custom title here. Examples are "Error log", "Server History", etc. The title displays at the top left corner of gauge.
messageLogColor Color (Hex without #) You can customize the color of the entire message log window by setting a hex value for this attribute.
messageGoesToLog Boolean (0/1) The messages streamed to the gauge can either be displayed in the message log window or can be passed to JavaScript (which we'll see next). This attribute lets you control whether the messages should be logged in the in-built log window.
messageGoesToFlex Boolean (0/1) When this attribute is set to 1, the gauge generates the FCMessage event everytime the message logger gets a message.
messageGoesToJS Boolean (0/1) This attribute lets you configure whether each message streamed from the server should be passed to a local JavaScript function.
messageJSHandler String If you've opted to pass each message to JavaScript function, this attribute lets you define the name of the function. This helps to create your custom functions to react to messages streamed from server.
messagePassAllToJS Boolean (0/1) Whether all parameters passed as part of message envelope be passed to the custom JavaScript function. We'll see the implementation of this later.

 

Now that the message logger is set up in the gauge, we'll next see how to stream messages from server to the message logger.