Sun GlassFish Web Space Server 10.0 Secure Web Access Add-On Guide

Troubleshooting Using Debug Logs

To troubleshoot a Rewriter problem, you need to enable debug logs.

Debug Messages are classified as follows.

Setting the Rewriter Debug Level

ProcedureTo Set the Rewriter Debug Level

  1. Log in as root to the Gateway machine and edit the following file:

  2. Set the debug level:

    The debug levels are:

    error - Only serious errors are logged in the debug file. Rewriter usually stops functioning when such errors occur.

    warning - Warning messages are logged.

    message - All debug messages are logged.

    off - No debug messages are logged.

  3. Specify the directory for the debug files in the following property of the file:

    where /var/opt/SUNWam/debug is the default debug directory.

  4. Restart the Gateway from a terminal window:

    ./psadmin start-sra-instance –u amadmin – f  <password file> –N <profile name>– t  <gateway>

Debug File Names

When the debug level is set to message, debug generates a set of files. Debug File Names lists the Rewriter files and the information contained within them.

Table 4–2 Rewriter Debug Files

File Name 



Contains all the rulesets which have been used for rewriting, are logged in this file. 

Original Pages 

Contains the page URI, resolveURI (if different than the page URI), content MIME, the ruleset that has been applied to the page, parser MIME, and the original content. 

Specific error/warning/messages related to parsing also appear in this file. 

In message mode full content is logged. In warning and error mode only exceptions that occurred during rewriting are logged. 

Rewritten Pages 

Contains the page URI, resolveURI (if different than the page URI), content MIME, ruleset that has been applied to the page, parser MIME, and the rewritten content. 

This is filled when the debug mode is set to message. 

Unaffected Pages 

Contains a list the pages that were not modified. 

URIInfo Pages 

Contains the URLs found and translated. Details of all the pages whose content remain same as original data are logged in this file. 

Details logged are: Page URI, MIME and Encoding data, rulesetID used for rewriting, and Parser MIME. 

In addition to the above files, Rewriter generates a file for debug messages that are not captured in the above files. This file name consists of two parts: the first part is either pwRewriter or psSRARewriter and the second part is an extension using either portal or the gateway-profile-name.

The debug files are displayed on the portal or the Gateway. These files are in the directory indicated in the file.

The Rewriter component generates the following set of files to help in debugging,







prefix is either psRewriter for URLScraper usage logs or psSRAPRewriter for Gateway usage logs.

extension is either portal for URLScraper usage or gateway-profile-name for Gateway usage.

For example, if the Rewriter on the Gateway is used to convert pages and the default Gateway profile is used, debug creates these files: