Hitachi

uCosminexus Application Server Expansion Guide


8.7.1 Using library JAR

In this method, you create a user-created class of the Filter class, Formatter class, or Handler class type in an application, add it to the logger, and use the class. In such cases, the following processes are executed:

You create the user-created class in this case according to the specification of J2SE java.util.logging. You can include the created class in the library JAR for WAR, EJB-JAR or import, in the same way as a normal user class, and then use the class.

The creation procedure for the user-created class, when using the class by including in the library JAR, is as follows:

  1. Set up security policy in security policy file (server.policy).

    For details on the security policy settings, see 8.8.2 Setting security policy.

  2. Create library JAR for import containing your own Handler class, Filter class, and Formatter class.

  3. Specify to import the class of the created library JAR, by using the server management commands.

  4. Create instances of your own class in the source program of the application.

  5. Implement the processing of connecting to the Logger class and Handler class.

    Note the following points when performing implementation by using the log manager (LogManager) of the J2SE1.4 specifications.

    • You cannot customize the log manager by using properties (such as java.util.logging.class and java.util.logging.file). If you customize the log manager, creating a user log might fail.

    • You cannot invoke the readConfiguration(InputStreamins) method of the log manager in a source program. If you invoke the readConfiguration(InputStreamins) method and initialize the configuration of the Logger class, the log system built using the user log functionality fails.

For details on the coding, see 8.12 Notes for using the user log functionality.