To troubleshoot a Rewriter problem, you need to enable debug logs.
Debug Messages are classified as follows.
Error– errors that Rewriter cannot recover from
Warning– warnings that do not critically affect the functioning of Rewriter. Rewriter is able to recover this type of error, but some misbehavior may or may not result. Some messages shown in warnings are informational. For example “Not rewriting image content” is logged as a warning message. This is fine as Rewriter is not supposed to rewrite the images.
Message– the highest level of information that Rewriter provides.
Log in as root to the Gateway machine and edit the following file:
gateway-install-root/SUNWam/config/AMConfig-instance-name.properties |
Set the debug level:
com.iplanet.services.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.
Specify the directory for the debug files in the following property of the AMConfig-instance-name.properties file:
com.iplanet.services.debug.directory=/var/opt/SUNWam/debug |
where /var/opt/SUNWam/debug is the default debug directory.
Restart the Gateway from a terminal window:
./psadmin start-sra-instance –u amadmin – f <password file> –N <profile name>– t <gateway> |
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 |
Information |
---|---|
RuleSetInfo |
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 AMConfig-instance-name.properties file.
The Rewriter component generates the following set of files to help in debugging,
prefix_RuleSetInfo.extension
prefix_OrginalPages.extension
prefix_RewrittenPages.extension
prefix_UnaffectedPages.extension
prefix_URIInfo.extension
where
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:
psSRAPRewriter_RuleSetInfo.default
psSRAPRewriter_OriginalPages.default
psSRAPRewriter_RewrittenPages.default
psSRAPRewriter_UnaffectedPages.default
psSRAPRewriter_URIInfo.default
psSRAPRewriter.default