Sun Java System Access Manager 7 2005Q4 Developer's Guide

Using the Logging Sample Files

The sample files demonstrate how you can use the Access Manager Logging APIs for to log operations. You can execute the samples through the command line. You must have super user privileges to run the RunSample and RunLogReader programs and to access AMConfig.properties.

ProcedureTo Run the Sample Programs on Solaris

  1. In the Makefile, RunSample, and RunLogReader files, set the following variables. The variables may already have been set during installation.

    AM_HOME

    Set this to refer to the where Access Manager server is installed.

    JAVA_HOME

    Set this variable to your installation of the JDK. The JDK version should be greater than or equal to 1.3.1_06.

    JDK14

    Set this variable to true if your JAVA_HOME points to JDK 1.4 or newer version else set it to false

    LOCAL_LOGGING

    Set this variable to true if you are executing this sample at complete Access Manager installation which will perform local logging. If you are executing this sample from a SUNWamsdk only install then set it to false which will perform remote logging (logging at server side).

  2. Set the LD_LIBRARY_PATH as is appropriate for your installation.

  3. Run the gmake command to compile the sample program.

  4. Run the following chmod command:

    chmod +x RunSample RunLogReader

  5. Run the following command to run the logging sample program:

    ./RunSample [ -o organizationName] [ -u userName -p userPassword ] -n logName -m message -l loggedByUser -w loggedByUserPassword

    orgName

    Name of the organization. This is an optional parameter. If a value is not provided, Access Manager assumes the value to be the root organization.

    userName

    Name of the user on whose behalf the logging is performed. This is an optional parameter.

    userPassword

    Password for authenticating the user. This value must be provided if userName is provided.

    logName

    Name of the log file.

    message

    Message to be logged to the log file.

    loggedByUser

    Name of the administrator user who is logging the message.

    loggedByUserPassword

    Password to authenticate the administrator user.

    Example:

    $ ./RunSample -u amadmin -p 11111111 -n testLog.access -m "trying test logging" -l amadmin -w 11111111

  6. Run the log reader program by running the following command:

    ./RunLogReader -o organizationName -u userName 
    			-p  userPassword 	[-n logName]
    
    organizationName

    Name of the organization. This is a required parameter.

    username

    Name of the user who is accessing the log file or table. This is a required parameter.

    userpassword

    Password to authenticate the user. This is a required parameter.

    logName

    Name of the log file or table. This parameter is optional. You can select the log file or table when running the program.

    Example :

    $ ./RunLogReader -u amadmin -p 11111111 -o dc=example,dc=com
    			 -n testLog.access
    

ProcedureTo Run the Sample Programs on Windows 2000

  1. In the make.bat file, set the following variables:

    BASE

    Set this to refer to the where Access Manager server is installed.

    JAVA_HOME

    Set this variable to your installation of the JDK. The JDK version should be greater than or equal to 1.3.1_06.

    JDK14

    Set this variable to true if your JAVA_HOME points to JDK 1.4 or newer version. Otherwise, set it to false.

    LOCAL_LOGGING

    Set this variable to true if you are executing this sample at complete Access Manager installation which will perform local logging. If you are executing this sample from an SUNWamsdk only install then set it to false which will perform remote logging (logging at server side).

  2. Set the LD_LIBRARY_PATH as is appropriate for your installation.

  3. Compile the program by running the make command.

  4. Run the sample program by running the make run command:

    make run [-o organizationName]
    			[-u userName -p  userPassword]	-n logName  
    						-m message -l  loggedByUser 
    										-wloggedByUserPassword
    
    orgName

    Name of the organization. This is an optional parameter. If a value is not provided, Access Manager assumes the value to be the root organization.

    userName

    Name of the user on whose behalf the logging is performed. This is an optional parameter.

    userPassword

    Password for authenticating the user. This value must be provided if userName is provided.

    logName

    Name of the log file.

    message

    Message to be logged to the log file.

    loggedByUser

    Name of the administrator user who is logging the message.

    loggedByUserPassword

    Password to authenticate the administrator user.

    Example:

    c> make run -u amadmin -p 11111111 -n testLog.access 
    			-m "trying test logging" -l amadmin -w 11111111