Sun GlassFish Enterprise Server v3 Prelude Administration Guide

ProcedureTo Add a Log Handler

A comma-separated list of log handlers is installed during startup of the JavaTM Virtual Machine (JVMTM) host. The default log handler that is provided in the logging. properties file, ConsoleHandler, is configured as follows:

handlers= java.util.logging.ConsoleHandler

In Enterprise Server, the best approach to developing a handler is to define a Hundred-Kilobyte Kernel (HK2) component which implements the handler contract. Enterprise Server registers this handler automatically because it is an HK2 component, and there is no task required of the administrator.

To implement a new handler that is not developed as an HK2 component, you need to add the new handler to the file after the developer has put the new handler JAR file into the /lib directory.

  1. In a text editor, add the new file handler to the line that begins with handlers=.

  2. Save the file.

  3. To apply your changes, restart Enterprise Server.

    1. Stop Enterprise Server.

      For instructions, see To Stop a Domain (or Server).

    2. Start Enterprise Server.

      For instructions, see To Start a Domain (or Server).

Example 9–2 Adding a New Log Handler

The following example adds the new logger com.example.logging.MyHandler:


handlers= java.util.logging.ConsoleHandler


handlers= java.util.logging.ConsoleHandler, com.example.logging.MyHandler