Chapter 8. Logging

Table of Contents

8.1. Overview
8.2. Basic JEUS Logger Structure
8.2.1. Outline
8.2.2. JEUS Launcher Logger
8.2.3. JEUS Server Logger
8.2.4. Access Logger
8.2.5. User Logger
8.2.6. Logger List
8.2.7. Log Messages with Module Names
8.3. Logging Configuration
8.3.1. Checking Logger Information
8.3.2. Dynamically Configuring a Logger
8.3.3. Standard Output and Standard Error Log Format Configuration
8.3.4. Logger Configuration
8.3.5. Log File Rotation Configuration
8.3.6. Property Configuration

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.

Note

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.

DivisionDescription
File HandlerRecords log messages recorded by a logger to a file.
SMTP HandlerRecords log messages through e-mail.
Socket HandlerRecords logs through a specified IP.
User HandlerRecords 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.

Note

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.

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.

Note

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.

servlet/access.log

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.

JeusLauncher.log

Log file for the information created by the launcher to start the server and the log messages created during server startup.

JeusServer.log

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.

jvm.log

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.

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 screen. 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".


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

    ItemDescription
    TimeEntered in the "Year. Month. Day. Hour: Minute: Second" format.
    Level

    Each log level output is mapped to a number.

    • 0: SEVERE

    • 1: WARNING

    • 2: INFO

    • 3: CONFIG

    • 4: FINE

    • 5: FINER

    • 6: FINEST

    • 7: ALL

    Thread informationInformation 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 IDRepresents 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 messageContains activities on the server while it is running

Note

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.


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".


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.

Warning

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.


The previous logs show that the 39 bites of response was output at 23: 29: 08 +0900 on May 10th 2012 as a result of requesting '/examples/test1.jsp' from '127.0.0.1'. 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.

  • EJB loggers

    ItemDescription
    jeus.ejb.beanEJB Home/Object stub logger
    jeus.ejb.clusterEJB cluster logger
    jeus.ejb.compilerEJB stub compiler logger
    jeus.ejb.connectorMDB and resource adapter logger
    jeus.ejb.containerEJB container logger
    jeus.ejb.ejbserverEJB engine logger
    jeus.ejb.interopEJB CORBA linkage logger
    jeus.ejb.persistenceCMP logger
    jeus.ejb.schemaEJB QL logger
    jeus.ejb.timerEJB Timer logger
    jeus.ejb.transactionEJB Transaction & Synchronization logger
    jeus.ejb.webserverEJB class FTP logger
    jeus.ejb.utilOther logger
  • JPA loggers

    ItemDescription
    jeus.persistenceTop-level logger of the JPA module
    jeus.persistence.providerTop-level logger of TopLink Essentials (default provider)
    jeus.persistence.containerContainer logger for JPA
  • Servlet loggers

    ItemDescription
    jeus.servlet.commonCommon servlet module logger
    jeus.servlet.connectionConnector logger
    jeus.servlet.connectorNIO connector logger
    jeus.servlet.deploymentDeploy logger
    jeus.servlet.engineMain servlet processing logger
    jeus.servlet.filterFilter logger
    jeus.servlet.jspJSP logger
    jeus.servlet.listenerServlet listener logger
    jeus.servlet.loaderClass loader logger
    jeus.servlet.propertyProperty logger
    jeus.servlet.servletsLogger for servlets that are provided by JEUS
    jeus.servlet.utilLogger that is used in the utility
    jeus.webserverLogger that is used in the FTP class service

  • Session manager loggers

    ItemDescription
    jeus.sessionSession Manager's top-level logger that is used in common
    jeus.session.centralCentral session manager logger
    jeus.session.distributedDistributed session manager logger
  • Web service loggers

    • The JAX-RPC/SAAJ loggers

      ItemDescription
      jeus.webservices.clientjeus.webservices.client package (client invocation framework) logger
      jeus.webservices.encodingSOAP serialize/deserialize logger
      jeus.webservices.messageSAAJ and SOAP message logger
      jeus.webservices.wsdlLogger for WSDL handling
      jeus.webservicesOther web service loggers
    • The UDDI logger

      ItemDescription
      jeus.uddi.datastoreDatabase processing logger
      jeus.uddi.functionUDDI API message processing logger
      jeus.uddi.judyRegistry server engine logger
      jeus.uddi.registryTransport layer, request/response processing, and registry engine logger
    • The WS-* logger (based on JAX-RPC)

      ItemDescription
      jeus.webservices.wssws-security logger
    • Others

      ItemDescription
      jeus.xml.binding.webservicesHelperLogger for DD binding used in EWS(JSR109)
  • Transaction logger

    ItemDescription
    jeus.transactionLogger that is generally used by the transaction manager
    jeus.transaction.loggingResource factory logger used for recovery
    jeus.transaction.otsOTS logger
    jeus.transaction.recoveryLogger that records transaction recovery
  • Security logger

    ItemDescription
    jeus.securityJEUS security logger
    jeus.security.impl.loginJEUS security login service logger
    jeus.security.utilJEUS security utility logger
  • Other key loggers

    ItemDescription
    jeus.classloaderJEUS class loading logger
    jeus.clusteringJEUS server cluster logger
    jeus.configLogger for changing dynamic configurations of JEUS
    jeus.connectorJ2EE connector logger
    jeus.converterXML converter logger
    jeus.ddinitDeployment descriptor initializer logger
    jeus.deployApplication deploy logger
    jeus.domainDomain logger
    jeus.filetransferLogger for configuration and application file transmission
    jeus.ioJEUS network I/O library logger
    jeus.jdbcJDBC connection pool logger
    jeus.jmxJMX logger
    jeus.jndiJNDI logger
    jeus.jnlpJNLP logger
    jeus.jtmaxJTmax logger
    jeus.managementJMX MBean framework logger
    jeus.netJEUS network API logger
    jeus.rmiJEUS RMI logger
    jeus.schedulerJEUS scheduler logger
    jeus.serviceJEUS service MBean logger

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.

Note

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.

Loggers or handlers can be dynamically added, deleted, or modified at runtime by using the console tool or WebAdmin.

Using WebAdmin

The following describes the process of dynamically adding a log to a server from the log configuration screen in WebAdmin.

  1. Select [Servers] from the left panel of WebAdmin to go to the server list. Then, select server1 to go to the configuration screen.

    Select [Basic Info] from the configuration screen and then select [System Logging].


  2. 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.


  3. Click [Add]. Configure the logger name and level, and then click [OK].


  4. 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".


  5. Click [FILE HANDLER] to add a file handler.


  6. Enter the name of the file handler to add. Select the 'Valid Day' radio button and then click [OK].


    Configure Advanced Options if necessary.

  7. 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.


  8. Apply the changes to the server by clicking [Apply Changes].

  9. 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.

Note

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.

Using the Console Tool

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.6] 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(server
1)..
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.

Using WebAdmin

Select [Servers] from the left menu of WebAdmin to go to the server list. Select server1 to go to the server configuration screen. Then, select [Basic Info] from the server configuration menu, and then configure 'Log Stdout To Raw Format' setting in the Advanced Options section.


Note

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.

Using the Console Tool

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.7] 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                                     |
+----------------------------------+-------------------------------------------+
================================================================================

[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
================================================================================
+-----+----------+--------+------+----------+-----------+----------+-----+-----+
| Serv|   Base   |  Base  | Node |    JVM   | Action On | Stdout to| MEJB|Class|
| er  |  Listen  | Listen |      | Configs  | Resource  |Row Format|     | FTP |
|     | Address  |  Port  |      |          |   Leak    |          |     |     |
+-----+----------+--------+------+----------+-----------+----------+-----+-----+
| serv|          | 9836   |      | -Xmx512m | Warning   | false    |false|false|
|er1  |          |        |      |-XX:MaxPer|           |          |     |     |
|     |          |        |      |mSize=256m|           |          |     |     |
+-----+----------+--------+------+----------+-----------+----------+-----+-----+
================================================================================

The standard output uses the following format.

[Time] [Level] [The thread information that is logged] [STDOUT/STDERR] message
ItemDescription
[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.

  • STDOUT: When the message is standard output.

  • STDERR: When the message is standard error such as an exception.

  • UNKNOWN: Unknown.

MessageMessage 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.

Note

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.

Using WebAdmin

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.

ItemDescription
NameLogger name.
LevelLogger 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 ClassClass 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.

HandlerLogger handler. If the handler is not configured, jeus logger uses a file handler and other JEUS sub-loggers use the handler of jeus logger.

Note

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.