Adding TWGRas logging

Writing to standard output for logging is OK during the development process, but the preferred way to log messages in an extension is through RAS logging. RAS logging is advantageous because the file where the data is stored, TWGRas.log, wraps and does not fill up the disk (as the SDTOUT and SDTERR logging do).

The first thing to do is to get an basic understanding of RAS logging. Click here to read about it.

These steps outline the basic process:

  1. There is a class, TWGRas, with several static methods. Right now, you only need to know about 3 of these methods:
  2. You add debug messages to your code
  3. When the appropriate debugging is enabled, then the debug messages are logged.


Steps to update your extension

  1. Edit the code.
    1. Go to your extension code and edit the extension class.
  2. Add a TWGRas.debug message call.

  3. Change the code to look like this:


  4. Enable RAS logging.
  5. Click here for instructions. Since you added out debug message to the initialization code, you must use the twgras.properties file to enable RAS.

  6. Redeploy the extension.
  7. Whenever you modify the extension, you need to redeploy the extension on the IBM Director Server.

  8. Check the Product Information window.
  9. Go to the log directory and run:

    rasdump > rasdump..txt

    Look for the rasdump.txt file and find the debug message.


  10. You are now ready to start adding more pieces to your extension. Return to the Table of Contents and click "Adding Tasks"