12.2.4 Property setup file for the user log of Java applications
- Organization of this subsection
(1) Format
J2SE property file format.
Specify the key as follows:
key-name=value
- Specification method
-
-
The string up to the linefeed is a value.
-
The line beginning with a hash mark (#) is a comment.
-
If you define a line without a value, the line is ignored.
-
You cannot add alphanumeric strings such as spaces and comments after the value. If you add such values, they will be considered as invalid.
(Example) key-name=value#comment
-
(2) Functionality
This file specifies the system properties for the user log in the Java application when using the vbj command.
The properties set up in this file are read by the Java application and hence, you need to set the properties in the system properties. For details on the implementation of user log output in Java applications, see 8.11 Implementing and setting the user log output of EJB client applications (When using the vbj command) in the manual uCosminexus Application Server Expansion Guide.
(3) File name
Any storage location and file name is possible.
(4) Specifiable keys
The following table lists the keys that can be specified. For details on the keys, see 12.2.2(4)(a) Keys beginning with ejbserver.application. Also, if required, see 2.2.3(5)(a) Keys beginning with ejbserver.application.
|
Key name |
Contents |
|---|---|
|
ejbserver.application.userlog.CJLogHandler.handler-name.appname |
Specify the default application name that is output to the AppName field. |
|
ejbserver.application.userlog.CJLogHandler.handler-name.autoFlush.enabled |
Specify whether flush is to be carried out after the message is output. |
|
ejbserver.application.userlog.CJLogHandler.handler-name.count |
Specify the number of log files. |
|
ejbserver.application.userlog.CJLogHandler.handler-name.encoding |
Specify encoding of the character strings to be output. |
|
ejbserver.application.userlog.CJLogHandler.handler-name.filter |
Specify the filter to be used with its full name, including the package name. |
|
ejbserver.application.userlog.CJLogHandler.handler-name.formatter |
Specify the formatter that you will use along with its full name, including the package name. |
|
ejbserver.application.userlog.CJLogHandler.handler-name.level |
Specify an upper-limit of a log collection level. |
|
ejbserver.application.userlog.CJLogHandler.handler-name.limit |
Specify the capacity of a log file. |
|
ejbserver.application.userlog.CJLogHandler.handler-name.msgid |
Specify the default message ID that is output to the MsgID field. |
|
ejbserver.application.userlog.CJLogHandler.handler-name.path |
Specify the prefix of log file name. |
|
ejbserver.application.userlog.CJLogHandler.handler-name.separator |
Use the CJSimpleFormatter and specify a separator to output a message in one sentence. |
|
ejbserver.application.userlog.loggers |
Declare the names of the loggers to be used. |
|
ejbserver.application.userlog.Logger.logger-name.filter |
Specify the full name including the package name of the filter used in the logger. |
|
ejbserver.application.userlog.Logger.logger-name.handlers |
Specify the handler class for the specified logger name. |
|
ejbserver.application.userlog.Logger.logger-name.level |
Specify the output level of the logger. |
|
ejbserver.application.userlog.Logger.logger-name.useParentHandlers |
Specify whether the log record is to be transmitted from the logger that received the log record to the handler connected to the parent logger. |
(5) Examples of coding
The storage location is as follows:
-
In Windows
Cosminexus-installation-directory\CC\examples\userlog\sample.properties
-
In UNIX
/opt/Cosminexus/CC/examples/userlog/sample.properties
A sample is as follows:
# user-log handler function ejbserver.application.userlog.CJLogHandler.conf1.appname=my_app1 ejbserver.application.userlog.CJLogHandler.conf1.path=application1/logfileA ejbserver.application.userlog.CJLogHandler.conf1.limit=10485760 ejbserver.application.userlog.CJLogHandler.conf1.count=2 ejbserver.application.userlog.CJLogHandler.conf1.level=SEVERE # user-log logger function ejbserver.application.userlog.Logger.com.example.userlogger1.handlers=com.hitachi.software.ejb.application.userlog.CJMPMessageFileHandler;conf1 ejbserver.application.userlog.Logger.com.example.userlogger1.useParentHandlers=true ejbserver.application.userlog.Logger.com.example.userlogger1.level=INFO ejbserver.application.userlog.loggers=com.example.userlogger1