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...
- Access the WAS admin console and go to...
Resources | Resource environment | Resource environment providers | WP CommonComponentConfigService
- To view and edit the custom properties for this resource environment provider, click the Custom Properties link.
- Set the value of the property cc.isDebug to true.
- 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.
- Save and persist the changes to the master configuration.
- Restart the portal server.
Examples: To activate all iWidget related logging and tracing, we use the following line:
traceConfig: ["com.ibm.mm.iwidget.*"]
To set multiple patterns, you separate them by commas like this:
traceConfig: ["com.ibm.mm.iwidget.*", "com.ibm.portal.*", "com.ibm.portal.wps.*"]
Alternatively, we can achieve the same result using scripting tools that WAS provides.
Related: Configure custom properties for resource environment providers using wsadmin scriptingCapturing 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.
- Enable tracing via trace string.
- 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.
- Enable tracing using cookies.
- Open WAS admin console.
- Select Resources > Resource Environment > Resource Environment Providers.
- Select the WP ConfigService resource environment provider.
- Click custom properties.
- Change the resourceaggregation.client.debug.mode.allowed entry to true.
- Save the changes.
- 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