uCosminexus Application Server, Expansion Guide

[Contents][Index][Back][Next]

9.12 Notes for using the user log functionality

This section describes the notes for using the user log functionality.

Organization of this section
(1) Customizing LogManager
(2) Notes for using your own filters and formatters
(3) Connection between logger and handler
(4) Setting log output mode of EJB client applications
(5) Regarding the key in which the suffix of usrconf.properties ends with .level

(1) Customizing LogManager

You can customize LogManager of the J2SE standard by using the properties such as java.util.logging.config.class. However, do not perform customization when using the user log functionality provided by Application Server. In the setup of a log system, which uses properties used in the user log functionality, the user log functionality acquires the log configuration from the properties by using LogManager, when starting a J2EE server. As a result, if you customize LogManager, an attempt to set up a log configuration might fail.

If you execute the readConfiguration(InputStream ins) method of LogManager and initialize the log configuration in the source code of application, the log configuration set up using the user log functionality fails. Therefore, do not execute this method.

However, you can use the user log functionality even after customization, if the structure is such that the customized LogManager completely inherits the already specified log configuration (contents of LogManager) and includes the added independent processing.

(2) Notes for using your own filters and formatters

When a log message is output, the isLoggable method#1 of handler returns true#2, if the filter created by you, which is connected to the handler, throws an exception.

If the formatter created by you, which is connected to the handler, throws an exception, the handler cannot output a message that is formatted by the formatter. The message specified by you is output without any formatting by the formatter.

For details on the contents of the exceptions thrown by the filter and the formatter created by you, see cjexception.log.

#1
The isLoggable method determines the selection of a log message.

#2
true indicates that the message is targeted for output.

(3) Connection between logger and handler

You can connect multiple handlers to a logger. However, you cannot connect a handler (CJMessageFileHandler or CJMPMessageFileHandler) with the same settings to multiple loggers.

(4) Setting log output mode of EJB client applications

Two types of modes are used to output logs of EJB client applications. The operation mode that creates a subdirectory of a log output destination for processes is called the subdirectory exclusive mode. The operation mode that shares a subdirectory of log output destination with multiple processes is called the subdirectory common mode.

Because the subdirectory exclusive mode is used for compatibility with the versions earlier than 06-50, we recommend you to use the subdirectory common mode for creating an EJB client application.

Use the subdirectory common mode, if you want to use the user log functionality of EJB client applications or if you want to execute EJB client applications with the cjclstartap command.

For details on how to output logs of EJB applications, see 3.8 System log output of EJB client applications in the uCosminexus Application Server EJB Container Functionality Guide. For details on the subdirectory to which logs of EJB applications are output, see 7.6.1 Acquiring user logs of applications in the uCosminexus Application Server Operation, Monitoring, and Linkage Guide.

(5) Regarding the key in which the suffix of usrconf.properties ends with .level

In usrconf.properties of the J2EE server, among the keys in which the suffix ends with .level, the following phenomena occur if you set a key with a value other than SEVERE, WARNING, INFO, CONFIG, FINE, or FINEST in the value range.

  1. When you start the server, the java.util.logging.LogManager class checks the values of the keys, in which the suffix ends with .level, when reading the keys. If a value is out of range, java.util.logging.LogManager class outputs an error message to the standard error output.
    (Example) If you specify, sample.level=Error
    Bad level value for property : sample.level is output
  2. If the value of the user log functionality key, in which the suffix ends with .level is not appropriate, an error message is output in the same way as in case 1.

However, in both the cases, only a message is displayed and it does not affect the operation.