uCosminexus Application Server, Expansion Guide
You can use the Java logging APIs of J2SE for executing J2EE applications, batch applications, and EJB client applications to output user logs. A Java logging API is a highly versatile API that can output multiple items such as memories, consoles, and files. However, the logic is simple, so for applying the logic to a mission critical system, an application developer must implement reliable and durable classes for log output.
If you use the user log functionality, a highly reliable user log can be output, even if the classes for the log output are not implemented by the application developer.
You can output logs, which are output from J2EE applications, batch applications, and EJB client applications developed by using the Java logging APIs, in a format output by a component software of another Cosminexus system (Hitachi Trace Common Library format) by using Hitachi Trace Common Library. By using this library you can handle user logs in the same format as the other system logs, and the log operation can be highly reliable and unified.
You execute the user log output in accordance with the mechanism of the J2SE Java logging. With the Java logging, you use two types of elements, loggers and handlers. Note that loggers and handlers are the objects of the Logger class and the Handler class respectively.
The following figure shows the mechanism of Java logging.
Figure 9-2 Mechanism of Java logging
The following points describe the above figure:
With Application Server, the file handlers are provided to output logs in the Hitachi Trace Common Library format, in a file. The following sub-sections describe the provided file handlers for respective applications.
CJMessageFileHandler is provided as a file handler. You can specify the log output destination files, log levels, number of log files, and filters and formatters to be used for CJMessageFileHandler, when setting up a system. For details on setting the user log output of J2EE applications and batch applications, see 9.8 Setting the user log output of J2EE applications and 9.9 Setting the user log output of batch applications.
In a user log, if you want to output the message ID corresponding to the application name and message contents that are output by the log, you must implement the settings in J2EE applications or batch applications. In such cases, implement the settings by using a class for the extended LogRecord provided by Application Server (CJLogRecord class). For details on how to use the CJLogRecord class, see 9.4 Methods used in the user log output. For details on the APIs of the CJLogRecord class, see 7. APIs used in the user log functionality in the uCosminexus Application Server API Reference Guide.
CJMPMessageFileHandler is provided as a file handler. How to set up a user log of an EJB client application varies according to the command used to start the EJB client application. For details on how to set up the user log output for EJB client applications, see 9.10 Setting the user log output for EJB client applications (when using the cjclstartap command) or 9.11 Implementing and setting the user log output for EJB client applications (when using the vbj command).
All Rights Reserved. Copyright (C) 2013, 2015, Hitachi, Ltd.