Hitachi

uCosminexus Application Server Expansion Guide


8.6.3 Guidelines for creating and setting loggers and handlers

The following are the guidelines for creating and setting loggers and handlers:

The following figure shows an example of creating loggers and handlers.

Figure 8‒3: Example of creating loggers and handlers

[Figure]

In this example, two types of loggers (com.example.userlogger1 and com.example.userlogger2) are created for J2EE applications 1 and 2. To output two types of log files from com.example.userlogger1 depending on the output levels and the output contents of the log, two types of the CJMessageFileHandler handlers (conf1 and conf2) are created. With this configuration, you can output important user logs on and above the SEVERE level to the log file 1, and all the user logs on and above the INFO level to the log file 2. On the other hand, only one type of log file is output from com.example.userlogger2. In such cases, of all the logs specified from a J2EE application, the user logs that are up to the level specified in the logger of com.example.userlogger2 and the conf3 handler are output to the log file 3. If you want to output the log to the console, use the ConsoleHandler handler of the standard J2SE.

Set up the size and number of files of log files appropriately depending on the user log quantity, which is output by applications, and the specified output level.