+

Search Tips   |   Advanced Search

Logging and tracing client side rendering

Portal pages that are rendered in client side aggregation mode differ in their logging behavior from portal pages rendered in server side mode. For client side rendered pages, a considerable amount of code is written in JavaScript that is executed in the corresponding browser JavaScript engine rather than on the server. As a result, the corresponding logging and tracing information is collected in the browser and not on the server side.


Enable client side logging and tracing

To enable client side logging and tracing for console loggers in client web browsers, modify the custom properties cc.isDebug and cc.traceConfig in the WP CommonComponentConfigService. This resource environment provider manages many of the configurable options for the common component.

To enable logging and tracing for client side rendering...

  1. Access the WAS admin console and go to...

  2. To view and edit the custom properties for this resource environment provider, click the Custom Properties link.

  3. Set the value of the property cc.isDebug to true.

  4. Set the value of the property cc.traceConfig property to a value that represents a correctly formatted javascript array of strings. Each string in the array is the name of the componento trace. We can use the wildcard character asterisk ( * ) for multiple matching. Example:

      ["com.ibm.mashups.enabler.*","com.ibm.mashups.builder.model.ContextMenu"]

    This value adds client side trace logging for all components in the namespace com.ibm.mashups.enabler and the component com.ibm.mashups.builder.model.ContextMenu.

  5. Save and persist the changes to the master configuration.

  6. Restart the portal server.

Examples: To activate all iWidget related logging and tracing, we use the following line:

To set multiple patterns, you separate them by commas like this:

Alternatively, we can achieve the same result using scripting tools that WAS provides.
Related: Configure custom properties for resource environment providers using wsadmin scripting


Capturing the log statements

Client side log statements are written to the JavaScript console of the browser.

There are various ways of accessing the data written to the JavaScript console, depending on the type of browsethat we use.

For example, in Microsoft Internet Explorer v8 you access the console by selecting Tools > Developer Tools. For FireFox various plugins are available that provide access to the console, for example the Firebug plugin.


Enable module tracing

Enable tracing to debug the module information to improve performance.

We can enable a trace string so that debugging is enabled for all users. Or we can set a specific cookie so that debugging is only enabled for that user’s cookie.

  1. Enable tracing via trace string.

    1. To debug a module or theme, enable portal tracing using the following trace string:

        com.ibm.wps.resourceaggregator.CombinerDataSource.RemoteDebug=all

      This string loads the modules using separate links and script tags, isolating each one independently. It also loads debug versions of each contribution if the module definition has defined a debug version. Typically, the debug version is an uncompressed version of the <script> tag containing the same data as the normal version.

      Both using separate links and using uncompressed <script> tags makes it easier to debug a running Portal environment from the browser.

  2. Enable tracing using cookies.

    1. Open WAS admin console.

    2. Select Resources > Resource Environment > Resource Environment Providers.

    3. Select the WP ConfigService resource environment provider.

    4. Click custom properties.

    5. Change the resourceaggregation.client.debug.mode.allowed entry to true.

    6. Save the changes.

    7. Restart the portal server.

When a user sets a cookie named com.ibm.portal.resourceaggregator.client.debug.mode to true, debug versions of module contributions are loaded if defined and modules are loaded using separate links and script tags.


Parent: Logging and tracing