This chapter describes the JEUS logging system, JEUS logger structure, log message contents, and how to set each logger and handler.
JEUS logging stores and records information about the series of tasks executed on the system while JEUS was running. This function allows a system manager to obtain information about the tasks that are performed on JEUS, and to identify and handle runtime errors.
The JEUS logging system notifies the users about the events that occur in the system and applications. JEUS uses the standard logging API(java.util.logging) that is provided by Java SE. The logging system structure and configuration methods follow the logging API and directly reflects the logger, handler, and formatter structures. Developers can use jeus logger through the logging API.
Since JEUS logger system is implemented based on the Java SE Logging API, developers can customize the logger by using the API.
The JEUS launcher, JEUS server, and access log that is used by a web engine are jeus logger types. Each logger is created with "jeus" (the "jeus" here refers to the logger name, hereafter jeus logger) logger as the standard. JEUS server creates jeus logger by default. Various modules, which are created below jeus logger, can create and use the loggers below JEUS such as jeus.ejb.
The name of the top-level logger used in JEUS is jeus logger. The logger is created by default without additional configuration.
The following are the logger types that can be configured in the JEUS configuration file.
JEUS logger
User logger
Access logger used in the web engine
Sub logger of JEUS logger
Java logger
A handler records log messages that a logger outputs, and it always accompanies a logger. In JEUS, the following 4 handler types can be configured depending on the output destination of the log message. The log messages are recorded using the configured handler, and a file handler is used most commonly.
Division | Description |
---|---|
File Handler | Records log messages recorded by a logger to a file. |
SMTP Handler | Records log messages through e-mail. |
Socket Handler | Records logs through a specified IP. |
User Handler | Records log messages by using a user-configured handler. |
Refer to "8.3.1. Checking Logger Information" for more information about other handlers and how to set a handler in the JEUS configuration file. For more information about the logging system, refer to logging API in Java SE.
1. Console handlers can be configured up to JEUS 6, but not in JEUS 7.
2. JEUS 7 does not provide a console as a server process. Since a server starts through a launcher, the console is a process of the launcher not the server.
3. To output log messages from a server to a console tool, a launcher process must be running until the server shuts down. If the '-verbose' option is used to start the server, the launcher process does not terminate until the server shuts down and the log messages started by the server are outputted to the console.
4. Asynchronous logging is supported from JEUS 7 Fix #4. Logging is handled by a logger thread, not by a worker thread that calls log, to improve performance. If asynchronous logging is used, only file handler is supported because other handlers may delay logging. To use the other handlers, set the jeus.logging.useAsync option to false. When this logging is used, the jeus.access.logging.skip.when.busy option is set to true. This configuration automatically detects that a web worker which needs high performance waits for logging. Therefore, an access logger does not need to wait for logging.
This section describes the basic concepts and configuration methods of jeus logger.
By default, jeus logger exists even if a logger is not configured on the server. It uses a file handler and allows the rotation of the e-mail log files. Refer to "8.3.1. Checking Logger Information" for more information about the log rotation and file handlers.
Jeus logger cannot be deleted by using the command that deletes loggers. If jeus logger is deleted when no other logger has been configured, no log messages are logged, causing problem with operation. In order to prevent leaving a logger on a server, set jeus logger level to OFF.
Deleting a server registered in the domain does not delete the log directory of the server. Since the logger provides important information for the administrator to view at any time, it is left for the administrator to delete the logger.
If a file name is not separately configured in the logger, then the log files are created in a location that is set on JEUS. The following is the structure of the log directory.
The following describes the default log files created in the log directory.
Access log file for web application requests. By default, the requests that are sent to any web application on the server are recorded in this file. When a virtual host is configured on the web engine, a directory with the name of the virtual host is created below the servlet directory. The access.log files are created below this directory where the requests sent to the host are logged.
Log file for the information created by the launcher to start the server and the log messages created during server startup.
Basic log file of the server. If a server does not have logger-related configurations, this file becomes the basic log file of all the loggers including jeus logger.
GC logs or thread dumps that occur on the server JVM. This file is created when a specific JVM option is used to start a server through a launcher.
Add the following to the JVM option when starting a server through a launcher.
-XX:+UnlockDiagnosticVMOptions -XX:+LogVMOutput -XX:LogFile=SERVER_HOME/logs/jvm.log
Since the server's thread dump is not output to the console because the server is running as a background process, a separate file must be configured for JVM logs. To change the log file path, add the '-XX:LogFile' option to the JVM options of the server.
A gc log file can be specified by using the "-Xloggc:" and "-Xverbosegclog:" option for Oracle and IBM systems respectively. Since JEUS automatically appends a time stamp to a specified log file, the file can be identified from a gc log file created whenever JEUS starts.
Log Directory Configuration
Use WebAdmin to set a log directory to save all logs created on the server in (including rotation backup logs) as in the following example.
Select [Servers] from the left menu of WebAdmin, and then select a desired server from the server list to go to the server configuration page. Go to [Basic] > [Basic Info], and set the desired directory path in the Log Home textbox. If a log file path is created by using an absolute path, then the absolute path takes precedence over this setting.
A launcher is used to start a server. After a server is started using a script or a start command, the launcher executes, reads the configuration file, and starts the server. The log messages that are created by the launcher at server startup are recorded in the JeusLauncher.log file and the console. A launcher process usually terminates after the server starts and just leaves the server boot log through the launcher log. However, if the '-verbose' option is used to start a server, the launcher process does not terminate until the server shuts down and all log messages created while the server is running are saved through the launcher's console and file.
The launcher process separately logs messages that the server logger logs in order to handle situations where the server cannot perform logging while the server is booting. For example, if the server fails to start because of a configuration file error, or if the server starts but it stops before the server logger is initialized due to a failure, the log messages that can show the cause of the failure are not logged by the server. Therefore, the launcher records the server boot log using its own logger so that the user can handle startup errors by checking the launcher log. For more information about the launcher, refer to "1.6. Launcher".
[Example 8.1] Log Messages Created by the Launcher during Startup Failure due to Configuration File Error
[2016.08.24 12:38:52][0] [launcher-1] [XmlValidationEventHandler] [FATAL_ERROR] Invalid content was found starting with element <system-clustering-framework> (of parent element <domain>). One of '{password-validator, admin-server-name}' is expected. [2016.08.24 12:38:52][0] [launcher-1] [SERVER-0522] An exception occurred while processing [domain.xml]. <<__Exception__>> jeus.xml.binding.JeusJAXBException: Unmarshalling the XML descriptor failed: domain.xml class org.xml.sax.SAXParseException : cvc-complex-type.2.4.a: Invalid content was found starting with element 'system-clustering-framework'. One of '{"http://www.tmaxsoft.com/xml/ns/jeus":password-validator, "http://www.tmaxsoft.com/xml/ns/jeus":admin-server-name}' is expected.. at jeus.xml.binding.BindingHelper.getDescriptor(BindingHelper.java:96) at jeus.service.descriptor.DescriptorFile.getDeploymentDescriptor(DescriptorFile.java:210) at jeus.service.descriptor.JEUSDomainDescriptorFile.getConfigDescriptor(JEUSDomainDescriptorFile.java:54) at jeus.launcher.Launcher.initDomainType(Launcher.java:222) at jeus.launcher.Launcher.readDescriptor(Launcher.java:210) at jeus.launcher.Launcher.start(Launcher.java:105) at jeus.launcher.Launcher.main(Launcher.java:58)
The JEUS server logger logs messages that are created while a server is running. Each message contains activities on the server while it is running.
The default JEUS logger is called jeus logger, which is the top-level logger. The sub loggers of jeus logger are logged using jeus logger's handler. The loggers and handlers on the server can be dynamically added, deleted, or changed.
It is possible to change the format of log messages by using the formatter-class. When there is no configuration, the jeus.util.logging.SimpleFormatter which is a basic formatter from JEUS is used.
[Time] [Level] [Thread information] [Log message ID] of log message
Item | Description |
---|---|
Time | Entered in the "Year. Month. Day. Hour: Minute: Second" format. |
Level | Each log level output is mapped to a number.
|
Thread information | Information of the thread that logs the message. Expressed as the combination of the process and thread number separated by a "-". Log messages with the same thread information are logged by the same thread. |
Log message ID | Represents information about each module that outputs a log. Expressed as the combination of the module name and message number separated by "-". Refer to "8.2.7. Log Messages with Module Names" for the name of each module. |
Log message | Contains activities on the server while it is running |
The log format of the Launcher process is the same as that of the server process.
The following is an example of the log messages output by JEUS server.
[Example 8.2] Server Log Message Output Example
[2016.08.24 10:36:17][0] [adminServer-1] [SERVER-0000] Version information - JEUS 8 (8.0.0.0-b83). [2016.08.24 10:36:17][0] [adminServer-1] [SERVER-0001] java.specification.version=[1.7], java.runtime.version=[1.7.0_75-b13], vendor=[Oracle Corporation] [2016.08.24 10:36:17][2] [adminServer-1] [SERVER-0002] Domain=[domain1], Server=[adminServer], baseport=[9736], pid=[9316] [2016.08.24 10:36:17][2] [adminServer-1] [SERVER-0004] The current system time zone : Korea Standard Time [2016.08.24 10:36:17][2] [adminServer-1] [WSVC-3805] JAX-RS Implementation libraries are added to the classpath of RootClassLoader: [library-ref:name=jax-rs, specVersion=2.0.1, implVersion=0] [2016.08.24 10:36:17][2] [adminServer-1] [SERVER-0571] All JEUS system properties have been confirmed. [2016.08.24 10:36:17][2] [adminServer-1] [SERVER-0568] Service address='0.0.0.0:9736', hostname='hahehihowin7', representation ip='192.168.15.45' [2016.08.24 10:36:17][2] [adminServer-1] [SERVER-0561] The default RMI export port = 9743 and bind address = /0.0.0.0.
The previous example shows that the first message was output
at 15:02:37 on May 9th, 2012. This message, server message number 000,
was logged by thread number 1 on the server named "adminServer". It is
the first message output for the server showing that JEUS server has
started to boot and the version of JEUS.
Other messages are also logged by the same process, and the server module messages are also output. The previous log messages occurred while a server was booting up, and they include environment information such as the Java version, process ID, timezone, and network information.
JEUS provides jeus.util.logging.SimpleFormatter as the default formatter of the server logger as well as the jeus.util.logging.SimpleMillisFormatter. This formatter is very similar to the default formatter, and it adds milliseconds to its time output.
The following is an example of the log messages that are created with the SimpleMillisFormatter. For more information about the formatter configuration, refer to "8.3. Logging Configuration".
[Example 8.3] Example of Server Log Message created with SimpleMillisFormatter
[2016.08.24 10:42:51.385][0] [adminServer-1] [SERVER-0000] Version information - JEUS 8 (8.0.0.0-b83). [2016.08.24 10:42:51.385][0] [adminServer-1] [SERVER-0001] java.specification.version=[1.7], java.runtime.version=[1.7.0_75-b13], vendor=[Oracle Corporation] [2016.08.24 10:42:51.387][2] [adminServer-1] [SERVER-0002] Domain=[domain1], Server=[adminServer], baseport=[9736], pid=[13364] [2016.08.24 10:42:51.387][2] [adminServer-1] [SERVER-0004] The current system time zone : Korea Standard Time [2016.08.24 10:42:51.560][2] [adminServer-1] [WSVC-3805] JAX-RS Implementation libraries are added to the classpath of RootClassLoader: [library-ref:name=jax-rs, specVersion=2.0.1, implVersion=0] [2016.08.24 10:42:51.560][2] [adminServer-1] [SERVER-0571] All JEUS system properties have been confirmed. [2016.08.24 10:42:51.568][2] [adminServer-1] [SERVER-0568] Service address='0.0.0.0:9736', hostname='hahehihowin7', representation ip='192.168.15.45' [2016.08.24 10:42:51.580][2] [adminServer-1] [SERVER-0561] The default RMI export port = 9743 and bind address = /0.0.0.0.
This logger records all application requests processed by the server. It records information about web applications requests. This section describes access loggers in web engines.
Access loggers in a web engine record all requests processed by the web engine. Access loggers specify the information accessed from the application and contents to record so that administrators can obtain the necessary information. After the web engine finishes processing all requests on the web engine, the access logger records the configured information.
Logs that are recorded by the access logger on the web engine usually support common log format. This format is commonly used in many areas such as Apache and provides a lot of information when analyzing access logs. Also, there are many tools available for analyzing common log formats that are helpful in analyzing access logs.
JEUS 6 does not support the common log format.
A virtual host can be configured for a web engine. When a virtual host is configured, separate access logs can be gained by configuring access loggers in each virtual host. The following is the name of the access log of a virtual host.
SERVER_HOME/logs/servlet/virtual host name/access.log
If an access log is recorded in the basic access log format of the web engine, the following logs will be in the access.log.
192.168.15.57 [29/Aug/2016:17:37:02 +0900] "GET /example/test1.jsp HTTP/1.1" 200 5 38
The previous logs show that the 38 bites of response was output at 17:37:02 +0900 on Aug 29th 2016 as a result of requesting '/example/test1.jsp' from '192.168.15.57'. For more information about the log format, refer to the documents about the common log format.
Refer to JEUS Web Engine Guide. Section 1.6.10, “Configuring Access Logs” for more information about changing the log format or configuring other access loggers on a web engine.
A user logger is provided for each JEUS server so that the developer does not need to use a separate logger. It is possible to use a user logger through java.util.logging.logger API of Java SE Logging API.
The following describes loggers.
EJB loggers
Item | Description |
---|---|
jeus.ejb.bean | EJB Home/Object stub logger |
jeus.ejb.cluster | EJB cluster logger |
jeus.ejb.compiler | EJB stub compiler logger |
jeus.ejb.connector | MDB and resource adapter logger |
jeus.ejb.container | EJB container logger |
jeus.ejb.ejbserver | EJB engine logger |
jeus.ejb.interop | EJB CORBA linkage logger |
jeus.ejb.persistence | CMP logger |
jeus.ejb.schema | EJB QL logger |
jeus.ejb.timer | EJB Timer logger |
jeus.ejb.transaction | EJB Transaction & Synchronization logger |
jeus.ejb.webserver | EJB class FTP logger |
jeus.ejb.util | Other logger |
JPA loggers
Item | Description |
---|---|
jeus.persistence | Top-level logger of the JPA module |
jeus.persistence.provider | Top-level logger of TopLink Essentials (default provider) |
jeus.persistence.container | Container logger for JPA |
Servlet loggers
Item | Description |
---|---|
jeus.servlet.common | Common servlet module logger |
jeus.servlet.connection | Connector logger |
jeus.servlet.connector | NIO connector logger |
jeus.servlet.deployment | Deploy logger |
jeus.servlet.engine | Main servlet processing logger |
jeus.servlet.filter | Filter logger |
jeus.servlet.jsp | JSP logger |
jeus.servlet.listener | Servlet listener logger |
jeus.servlet.loader | Class loader logger |
jeus.servlet.property | Property logger |
jeus.servlet.servlets | Logger for servlets that are provided by JEUS |
jeus.servlet.util | Logger that is used in the utility |
jeus.websocket | Logger related to websocket servers. |
jeus.webserver | Logger that is used in the FTP class service |
Session manager loggers
Item | Description |
---|---|
jeus.session | Session Manager's top-level logger that is used in common |
jeus.session.distributed | Distributed session manager logger |
Web service loggers
The JAX-RPC/SAAJ loggers
Item | Description |
---|---|
jeus.webservices.client | jeus.webservices.client package (client invocation framework) logger |
jeus.webservices.encoding | SOAP serialize/deserialize logger |
jeus.webservices.message | SAAJ and SOAP message logger |
jeus.webservices.wsdl | Logger for WSDL handling |
jeus.webservices | Other web service loggers |
The UDDI logger
Item | Description |
---|---|
jeus.uddi.datastore | Database processing logger |
jeus.uddi.function | UDDI API message processing logger |
jeus.uddi.judy | Registry server engine logger |
jeus.uddi.registry | Transport layer, request/response processing, and registry engine logger |
The WS-* logger (based on JAX-RPC)
Item | Description |
---|---|
jeus.webservices.wss | ws-security logger |
Others
Item | Description |
---|---|
jeus.xml.binding.webservicesHelper | Logger for DD binding used in EWS (JSR109) |
Transaction logger
Item | Description |
---|---|
jeus.transaction | Logger that is generally used by the transaction manager |
jeus.transaction.logging | Resource factory logger used for recovery |
jeus.transaction.ots | OTS logger |
jeus.transaction.recovery | Logger that records transaction recovery |
Security logger
Item | Description |
---|---|
jeus.security | JEUS security logger |
jeus.security.impl.login | JEUS security login service logger |
jeus.security.util | JEUS security utility logger |
Other key loggers
Item | Description |
---|---|
jeus.classloader | JEUS class loading logger |
jeus.clustering | JEUS server cluster logger |
jeus.config | Logger for changing dynamic configurations of JEUS |
jeus.connector | J2EE connector logger |
jeus.converter | XML converter logger |
jeus.ddinit | Deployment descriptor initializer logger |
jeus.deploy | Application deploy logger |
jeus.domain | Domain logger |
jeus.filetransfer | Logger for configuration and application file transmission |
jeus.io | JEUS network I/O library logger |
jeus.jdbc | JDBC connection pool logger |
jeus.jmx | JMX logger |
jeus.jndi | JNDI logger |
jeus.jnlp | JNLP logger |
jeus.jtmax | JTmax logger |
jeus.management | JMX MBean framework logger |
jeus.net | JEUS network API logger |
jeus.rmi | JEUS RMI logger |
jeus.scheduler | JEUS scheduler logger |
jeus.service | JEUS service MBean logger |
jeus.weld | JEUS CDI logger |
Log messages in JEUS provide a lot of information. Log messages with information about modules have module names. This section describes these modules.
Module Name | Module information |
---|---|
Connector | Connector |
Console | Console command |
Config | Synchronization of configuration files and related modules |
CORBA | CORBA |
CPOOL | Connection |
D_Session | Distributed session server |
Deploy | Application deployment |
Domain | Domain |
EJB | EJB engine |
JDBC | JDBC |
JMS | JMS engine |
JMSC | JMS cluster |
JMSF | JMS failover |
JMX | JMX |
JMXR | JMX remote |
JNDI.Common | JNDI common |
JNDI.Context | JNDI context |
JNDI.Local | JNDI local client |
JNDI.Remote | JNDI remote client |
JNSS | JNDI server |
JPA | JPA |
JTMAX | JTMAX |
Launcher | JEUS launcher (launcher process) |
Network | JEUS network |
NodeManager | Node manager |
OTS | OTS |
SCF | SCF (JEUS System Clustering Framework) |
Scheduler | Scheduler |
Security | JEUS security |
SERVER | Module related to starting, stopping, and monitoring a server |
Session | Session server |
TM | Transaction manager |
TMRecovery | Recovery of the transaction manger |
UDDI | UDDI |
WEB | Servlet engine |
WebT | WebT |
WebtobLight | WebtoB |
WSS | Web service security |
WSVC | Web service |
This section describes how to configure and customize logging in JEUS.
The top-level logger, jeus logger, is created by default, but other loggers output log messages by using the handler of jeus logger when they are not configured. The file handler is used when jeus logger is not configured. If a server does not have any logger configuration, log messages created at server runtime is recorded in the default file. In this case, the log level is set to INFO, and jeus logger does not use the top-level logger's handler.
To check the log messages of a server in the console, use the '-verbose' option when starting the server.
When the '-verbose' option is used, the launcher process does not terminate until the server shuts down so that it can output server log messages to the console.
The following is an example of using the console tool and WebAdmin to check for information about jeus logger, the default logger.
Using WebAdmin
Select [Servers] from the left menu of WebAdmin and click on a server from the server list. Information about jeus logger can be checked in the [System Logging] menu.
Using the console tool
Execute log-level and list-log-handlers as shown in the following example to check for information about jeus logger and the handlers registered to it. For more information about each command, refer to JEUS Reference Book. "4.2.3. Server Management Commands".
[Example 8.4] Example of Checking jeus Logger Information in the Console Tool
[DAS]domain1.adminServer>log-level -server server1 jeus The logger[jeus] information for the server [server1] Information about the logger[jeus]. ================================================================================ Logger Name : jeus Level : INFO Use Parent Handlers : false +---------------------------------------------+----------------+---------------+ | Handler Name | Handler Type | Handler Level | +---------------------------------------------+----------------+---------------+ | jeus.util.logging.ConsoleHandler@2569862 | ConsoleHandler | ALL | | FileHandler | FileHandler | FINEST | +---------------------------------------------+----------------+---------------+ ================================================================================ [DAS]domain1.adminServer>modify-logger -server server1 jeus Show the current configuration. The logger[jeus] information for the server [server1] ================================================================================ +---------------------+--------------------------------------------------------+ | Name | Value | +---------------------+--------------------------------------------------------+ | Level | INFO | | Use Parent Handlers | false | | Formatter | jeus.util.logging.SimpleFormatter | +---------------------+--------------------------------------------------------+ ================================================================================ [DAS]domain1.adminServer>list-log-handlers -server server1 jeus List of Loggers ================================================================================ +-------------------------------------+----------------------------------------+ | Handler Name | FileHandler | | Handler Type | FileHandlerType | | Handler Level | FINEST | | Filename | JeusServer.log | | Enable Rotation | true | | Rotation Directory | ${SERVER_HOME}/logs | | Valid Day | 1 | | Buffer Size | 1024 | | Append Logs | true | +-------------------------------------+----------------------------------------+ ================================================================================
In the following cases, the console handler can be displayed when checking jeus logger information in jeusadmin.
When '-verbose' option is used to start a server.
When starting a server.
When the '-verbose' option is used to start a server, the console log is output through the launcher process. When the server is starting, log messages can also be displayed on the console screen through the launcher process.
Loggers or handlers can be dynamically added, deleted, or modified at runtime by using the console tool or WebAdmin.
The following describes the process of dynamically adding a log to a server from the log configuration page in WebAdmin.
Since the method for modifying and deleting a logger in WebAdmin is similar to the aforementioned method of adding a logger, detailed explanation has been omitted..
Select [Servers] from the left panel of WebAdmin to go to the server list. Then, select server1 to go to the configuration page.
Select [Basic Info] from the configuration page and then select [System Logging].
The lock for changing the configuration must be set before adding a logger to a server. To change the configuration, click [Lock & Edit] from the bottom left menu and configure the lock.
Once the lock is configured, [Add], located at the top of the logger list, is enabled.
Click [Add]. Configure the logger name and level, and then click [OK].
As shown in the following screenshot, a result message and the information about the newly added logger is displayed at the top of the screen. Now, click on the newly added logger "jeus.config".
Click [File Handler] to add a file handler.
Enter the name of the file handler to add. Select the 'Valid Day' radio button and then click [OK].
Configure Advanced Options if necessary.
The following screenshot shows the result of temporarily saving a new log handler. The result message is displayed at the top of the screen and the newly added handler appears in the handlers list.
Apply the changes to the server by clicking [Apply Changes].
A detailed result message for adding a logger and its handler and applying the changes to the server is displayed. Loggers and handlers can be dynamically added to a running server.
Logging configurations can be dynamically changed by using the add-logger, modify-logger, and remove-logger commands in the console tool.
The currently configured logger information can be checked by using the list-loggers command. For more information about each command, refer to JEUS Reference Book. "4.2.3. Server Management Commands".
[Example 8.5] Adding, Changing, and Deleting a Logger by using the Console Tool
[DAS]domain1.adminServer>list-loggers server1 List of Loggers ================================================================================ +-------------+-------+------------------+--------+----------------------------+ | Logger Name | Level | Use Parent | Filter | Formatter | | | | Handlers | | | +-------------+-------+------------------+--------+----------------------------+ | jeus | INFO | false | | jeus.util.logging.SimpleFor| | | | | |matter | +-------------+-------+------------------+--------+----------------------------+ ================================================================================ [DAS]domain1.adminServer>add-logger -server server1 jeus.ejb -level FINEST Successfully performed the ADD operation for The logger for the server(server1).. Check the results using "list-loggers or add-logger" [DAS]domain1.adminServer>add-logger -server server1 jeus.ejb.clustering -level FINEST Successfully performed the ADD operation for The logger for the server(server1).. Check the results using "list-loggers or add-logger" [DAS]domain1.adminServer>list-loggers server1 List of Loggers ================================================================================ +----------------+--------+----------------+--------+--------------------------+ | Logger Name | Level | Use Parent | Filter | Formatter | | | | Handlers | | | +----------------+--------+----------------+--------+--------------------------+ | jeus | INFO | false | | jeus.util.logging.SimpleF| | | | | |ormatter | +----------------+--------+----------------+--------+--------------------------+ | jeus.ejb | FINEST | true | | jeus.util.logging.SimpleF| | | | | |ormatter | +----------------+--------+----------------+--------+--------------------------+ | jeus.ejb.cluste| FINEST | true | | jeus.util.logging.SimpleF| |ring | | | |ormatter | +----------------+--------+----------------+--------+--------------------------+ ================================================================================ [DAS]domain1.adminServer>modify-logger -server server1 jeus.ejb.clustering -level FINE Successfully performed the MODIFY operation for The logger[jeus.ejb.clustering] information for the server [server1]. Check the results using "modify-logger" [DAS]domain1.adminServer>list-loggers server1 List of Loggers ================================================================================ +----------------+--------+----------------+--------+--------------------------+ | Logger Name | Level | Use Parent | Filter | Formatter | | | | Handlers | | | +----------------+--------+----------------+--------+--------------------------+ | jeus | INFO | false | | jeus.util.logging.SimpleF| | | | | |ormatter | +----------------+--------+----------------+--------+--------------------------+ | jeus.ejb | FINEST | true | | jeus.util.logging.SimpleF| | | | | |ormatter | +----------------+--------+----------------+--------+--------------------------+ | jeus.ejb.cluste| FINE | true | | jeus.util.logging.SimpleF| |ring | | | |ormatter | +----------------+--------+----------------+--------+--------------------------+ ================================================================================ [DAS]domain1.adminServer>remove-logger -server server1 jeus.ejb Successfully performed the REMOVE operation for The logger for the server(server1).. Check the results using "list-loggers or remove-logger" [DAS]domain1.adminServer>list-loggers server1 List of Loggers ================================================================================ +----------------+-------+----------------+--------+---------------------------+ | Logger Name | Level | Use Parent | Filter | Formatter | | | | Handlers | | | +----------------+-------+----------------+--------+---------------------------+ | jeus | INFO | false | | jeus.util.logging.SimpleFo| | | | | |rmatter | +----------------+-------+----------------+--------+---------------------------+ | jeus.ejb.cluste| FINE | true | | jeus.util.logging.SimpleFo| |ring | | | |rmatter | +----------------+-------+----------------+--------+---------------------------+ ================================================================================
JEUS enables the standard output and error to be output in the log format. By using the default format used in JEUS, standard output and standard error can be output in a format similar to jeus logger.
The following describes how to configure the standard output and error to the JEUS log format by using WebAdmin or the console tool.
Select [Servers] from the left menu of WebAdmin to go to the server list. Select server1 to go to the server configuration page. Then, select [Basic Info] from the server configuration menu, and then configure 'Log Stdout To Raw Format' setting in the Advanced Options section.
The default value for 'Log Stdout To Raw Format' is "true" which outputs standard output and error in raw format. In WebAdmin, uncheck this item to set it to "false" for using the log format.
The following is an example of using the console tool to configure the standard output and error to use the JEUS log format.
[Example 8.6] Configuring Standard Output and Error to JEUS Log Format in Console Tool
[DAS]domain1.adminServer>modify-server server1 Show the current configuration. server (server1) ================================================================================ +----------------------------------+-------------------------------------------+ | Node | node1 | | JVM Configs | -Xmx256m -XX:MaxPermSize=128m | | Action On Resource Leak | WARNING | | Stdout to Raw Format | true | | MEJB | false | | Class FTP | false | | Server Log Home Directory | none | +----------------------------------+-------------------------------------------+ ================================================================================ [DAS]domain1.adminServer>modify-server server1 -logStdoutToRawFormat false Successfully performed the MODIFY operation for server (server1). Check the results using "list-servers server1 or modify-server server1" [DAS]domain1.adminServer>list-servers server1 List of Servers ================================================================================ +-----+-------+-------+-----+-------+-------+-------+-----+------+-------+-----+ | Ser | Base | Base | Node| JVM |Action |Stdout | MEJB|Class |Server | Type| | ver |Listen |Listen | |Configs| On |to Raw | | FTP | Log | | | | Addre | Port | | |Resour | Format| | | Home | | | | ss | | | |ce Leak| | | |Direct | | | | | | | | | | | | ory | | +-----+-------+-------+-----+-------+-------+-------+-----+------+-------+-----+ | ser | | 9836 | nod | -Xmx2 | Warni | false | fal | false| none | ser | |ver1 | | |e1 |56m |ng | |se | | |ver | | | | | |-XX:Ma | | | | | | | | | | | |xPermS | | | | | | | | | | | |ize=12 | | | | | | | | | | | |8m | | | | | | | +-----+-------+-------+-----+-------+-------+-------+-----+------+-------+-----+ ================================================================================
The standard output uses the following format.
[Time] [Level] [The thread information that is logged] [STDOUT/STDERR] message
Item | Description |
---|---|
[Time] | Output in the form of "Year. Month. Day. Hour: Minute: Second". |
[Level] | Log level is mapped to a number. All logs are displayed as SEVERE (0). |
[Logging Thread Information] | Logging process (server or launcher) + "-" + thread number. The logs with the same thread information are logged by the same thread. |
[STDOUT/STDERR] | Option to set the message as standard output or standard error.
|
Message | Message to output through System.out or System.err. |
Loggers and handlers can be added, deleted, or modified by using WebAdmin or the console tool and the changes can be applied dynamically during runtime without restarting the server.
The level and option to use the parent handler (use-parent-handlers) can be configured and applied dynamically to the logger. Only the level can be applied dynamically to the handler, and only the file handler can be added or modified by using console tool command.
Select [Servers] from the left menu of WebAdmin, and select a server from the server list. Then, select [Basic] > [System Logging].
The following table describes the configuration items.
Item | Description |
---|---|
Name | Logger name. |
Level | Logger level. Only messages at or below this level is output through the logger. Set to one of logging API or SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, or ALL. (default value: INFO) |
Use Parent Handlers | Option to set a logger to use a handler of the parent logger as well as its own handler. Although the default value is true, it is set to false for jeus logger because the logger is the top-level logger of JEUS. If a logger's handler is not configured, this value must be set to true in order to be able to use the parent handlers. |
Filter Class | Class used for process filtering before the logger sends a log message to the handler. The class must be in the JAR file of the 'lib/application' directory. |
Formatter Class | Class used by the logger to format log messages before sending them to a handler. The class must be in the JAR file of the 'lib/application' directory. To set a log formatter, a handler must be configured in the logger and the formatter only handles the log messages that are output by the handler. |
Handler | Logger handler. If the handler is not configured, jeus logger uses a file handler and other JEUS sub-loggers use the handler of jeus logger. |
The log levels FATAL, NOTICE, INFORMATION, and DEBUG used in JEUS 4x are not available in JEUS 7.
Handlers include the file handler, SMTP handler, socket handler, and user handler. The following are the configuration items of each handler.
The file handler outputs log messages to the file.
The following describes the configuration items.
Item | Description |
---|---|
Name | Handler name. The name must be unique within each logger. If not set, a combination of the class name and hash code is used. |
File Name | Name of the file to which the handler outputs log messages. If an absolute path is used, then files are created in that path. Otherwise, the files are created in the path specified by each logger and messages are saved in them. |
Level | Level of the messages that the handler outputs. When the log messages that are output through the logger are forwarded to each handler used by the logger, log messages that correspond to the level of the handler are output by each handler. The default value is FINEST which means that all log messages through the logger are output by the handler. |
Enable Rotation | Option for a handler to use the log file rotation function. The rotation function is enabled by default. (default value: true) |
Rotation Count | Rotation count. Only applies when a handler uses the log file rotation. (Default Value: 10) |
Valid Day | Used when a handler outputs files by date. '_YYYYMMDD' is appended to the end of the file name. |
Valid Hour | Used when a handler creates files based on time. A valid-hour is a multiple of 24(3, 6...) or a number whose remainder is a multiple of 24(27, 30...). '_YYYYMMDD_HH' is appended to the end of the file name. |
Valid Size | Used when a handler outputs files based on size. Only applies when a handler uses the log file rotation function. |
Encoding | Encoding of handler's string output. The default value is system encoding. |
Filter Class | Used when a handler outputs log messages that are filtered. As for the logger's <filter-class>, a jar file with this class must be in the 'lib/application' directory. |
Append | Option to overwrite an existing file or append to it when outputting to a log file after server starts. (Default value: True)
|
Rotation Dir | Used only when the handler uses log file rotation. |
Buffer Size | Size of the buffer that is used when writing to a file. Logging performance improves as the buffer size increases, but more logs are lost if JEUS is abnormally terminated. (Default value: 1024, unit: kb) When the accumulated log messages in the buffer are larger than the configured buffer size, the log messages are written to the file. |
The SMTP handler sends log messages by e-mail. A single log message is sent to a single e-mail.
The following table describes the configuration items.
Item | Description |
---|---|
Name | Name used when a handler is visible in the tool. The name must be unique within the logger. If not set, a combination of the class name and hash code is used. |
Level | Level of the messages that the handler outputs. When log messages that are output through the logger are forwarded to each handler used by the logger, log messages that correspond to the level of the handler are output by the handler. The default value is FINEST which means that all log messages through the logger are output by each handler. |
Smtp Host Address | Host address of the e-mail recipient. |
From Address | E-mail sender address. |
Sender ID | Sender ID. |
Sender Password | Sender password. To encrypt and save it, use the format "{algorithm to be encrypted) encrypted algorithm". |
To Address | Address of the e-mail recipient. |
Property | There can be SMTP properties that are specific to each mail server. If there are additional properties other than the basic SMTP properties specified in the schema (WebAdmin), they can be added by using the “key,value” format. If there is an item that overlaps with the basic SMTP properties in the schema, the value in the schema (WebAdmin) takes precedence. |
Send For All Messages | Option to use the SMTP handler to send all messages. If set to false, only the e-mail sent messages are sent using this handler. This configuration is currently only available for user loggers. (Default value: false) |
Encoding | Encoding of handler's string output. The default value is system encoding. |
Filter Class | Used when a handler outputs log messages that are filtered. As for the logger's <filter-class>, a jar file with this class must be in the 'lib/application' directory. |
Cc Address | Addresses of the recipients who will receive a copy of the e-mail. |
Bcc Address | Addresses of the recipients who will receive a copy of the e-mail and whose addresses will be concealed. |
The socket handler sends log messages to the socket.
The following table describes the socket handler's configuration items.
Item | Description |
---|---|
Name | Specifies the name that will be used when a handler is shown on the tool. The name must be unique within one logger. If the name is not specified, use a name which combines the class name and the hash code. |
Level | Level of the messages that the handler outputs. When log messages that are output through the logger are forwarded to each handler used by the logger, log messages that correspond to the level of the handler are output by the handler. The default value is FINEST and all log messages through the logger are output by the handler. |
Address | IP address of the server that the handler accesses. |
Port | Port number of the machine that the handler accesses. |
Encoding | Encoding of handler's string output. The default value is system encoding. |
Filter Class | Used when a handler outputs log messages that are filtered. As for the logger filter-class, a jar file with this class must be in the 'lib/application' directory. |
The user handler specifies a user-defined handler class.
The following describes the configuration items.
Item | Description |
---|---|
Name | Handler name. The name must be unique within each logger. If not set, a combination of the class name and hash code is used. |
Level | Level of the messages that the handler outputs. When log messages that are output through the logger are forwarded to each handler used by the logger, log messages that correspond to the level of the handler are output by the handler. The default value is FINEST and all log messages through the logger are output by the handler. |
Handler Class | User-defined handler class. This class must be in the JAR file of 'lib/application' directory. The class must inherit the java.util.logging.Handler class of the logging API and implement the jeus.util.logging.JeusHandler interface. |
Handler Property | Properties to include in the map objects that are used in the setProperty() method of jeus.util.logging.JeusHandler. |
Formatter Class | Formatter class used by the handler. This class must be in the JAR file of 'lib/application' directory. In addition, it must implement the jeus.util.logging.JeusFormatter interface. (Default Value: jeus.util.logging.SimpleFormatter) |
Formatter Property | Properties to include in the map objects that are used in the setProperty() method of jeus.util.logging.JeusFormatter. |
Encoding | Encoding of handler's string output. The default value is system encoding. |
Filter Class | Used when a handler outputs log messages that are filtered. As for the logger filter-class, a jar file with this class must be in the 'lib/application' directory. |
When JEUS starts at a configured time or when the file size exceeds its limit, the current log file is automatically backed up under a different name and the file rotation allows new logs to be written to the existing file.
The logs are rotated based on three configuration items, Valid Day, Valid Hour, and Valid Size. If none of the items are configured, then the log file name is modified and backed up at midnight every day so that the existing log file can continue to be used for logging.
The following screenshot shows how to configure log file rotation of the File Handler in WebAdmin.
The following describes the properties required for configuration.
System properties
When the logger is configured in a standalone client, the log level can be configured using system properties.
Logging properties file
Logging can be configured in the Java logging property (logging.properties) file.
(Default path: JEUS_HOME/bin/logging.properties)
-Djava.util.logging.config.file = <property file path>
The jeuslogging.properties file used in JEUS 6 cannot be used in JEUS 7.
The following is the priority of level configurations apart from the dynamic configurations set by using JEUS tool.
System properties
Java logging.properties file
Logging configuration in domain.xml
The log level configured in the handler does not override this priority. Since logs are output through the handler, the handler has the highest priority. Note that the default log level of the handler is FINEST.