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.

8.1. Overview

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.

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.

8.2. Basic JEUS Logger Structure

This section describes the basic concepts and configuration methods of jeus logger.

8.2.1. Outline

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.

Log Directory Structure

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.

[Figure 8.1] Log Directory

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.

User-defined gc log file

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.

[Figure 8.2] Configuring Log Home Path

Configuring Log Home Path


8.2.2. JEUS Launcher Logger

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)

8.2.3. JEUS Server Logger

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.

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

8.2.4. Access Logger

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.

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

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.

8.2.5. User Logger

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.

8.2.6. Logger List

The following describes loggers.

  • 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.websocketLogger related to websocket servers.
    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.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
    jeus.weldJEUS CDI logger

8.2.7. Log Messages with Module Names

Log messages in JEUS provide a lot of information. Log messages with information about modules have module names. This section describes these modules.

Module NameModule information
ConnectorConnector
ConsoleConsole command
ConfigSynchronization of configuration files and related modules
CORBACORBA
CPOOLConnection
D_SessionDistributed session server
DeployApplication deployment
DomainDomain
EJBEJB engine
JDBCJDBC
JMSJMS engine
JMSCJMS cluster
JMSFJMS failover
JMXJMX
JMXRJMX remote
JNDI.CommonJNDI common
JNDI.ContextJNDI context
JNDI.LocalJNDI local client
JNDI.RemoteJNDI remote client
JNSSJNDI server
JPAJPA
JTMAXJTMAX
LauncherJEUS launcher (launcher process)
NetworkJEUS network
NodeManagerNode manager
OTSOTS
SCFSCF (JEUS System Clustering Framework)
SchedulerScheduler
SecurityJEUS security
SERVERModule related to starting, stopping, and monitoring a server
SessionSession server
TMTransaction manager
TMRecoveryRecovery of the transaction manger
UDDIUDDI
WEBServlet engine
WebTWebT
WebtobLightWebtoB
WSSWeb service security
WSVCWeb service

8.3. Logging Configuration

This section describes how to configure and customize logging in JEUS.

8.3.1. Checking Logger Information

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.

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

    [Figure 8.3] Checking jeus Logger Information in WebAdmin

    Checking jeus Logger Information in WebAdmin


    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.

8.3.2. Dynamically Configuring a 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 page in WebAdmin.

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

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

    [Figure 8.4] Dynamically Configuring a Logger in WebAdmin (1)

    Dynamically Configuring a Logger in WebAdmin (1)


  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.

    [Figure 8.5] Dynamically Configuring a Logger in WebAdmin (2)

    Dynamically Configuring a Logger in WebAdmin (2)

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

    [Figure 8.6] Dynamically Configuring a Logger in WebAdmin(3)

    Dynamically Configuring a Logger in WebAdmin(3)

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

    [Figure 8.7] Dynamically Configuring a Logger in WebAdmin (4)

    Dynamically Configuring a Logger in WebAdmin (4)


  5. Click [File Handler] to add a file handler.

    [Figure 8.8] Dynamically Configuring a Logger in WebAdmin (5)

    Dynamically Configuring a Logger in WebAdmin (5)


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

    [Figure 8.9] Dynamically Configuring a Logger in WebAdmin (6)

    Dynamically Configuring a Logger in WebAdmin (6)


    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.

    [Figure 8.10] Dynamically Configuring a Logger in WebAdmin (7)

    Dynamically Configuring a Logger in WebAdmin (7)


  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.

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


8.3.3. Standard Output and Standard Error Log Format Configuration

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 page. Then, select [Basic Info] from the server configuration menu, and then configure 'Log Stdout To Raw Format' setting in the Advanced Options section.

[Figure 8.11] Configuring Standard Output and Error to JEUS Log Format in WebAdmin

Configuring Standard Output and Error to JEUS Log Format in WebAdmin

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

8.3.4. Logger Configuration

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

[Figure 8.12] Logger Configuration Page in WebAdmin

Logger Configuration Page in WebAdmin

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.

  • File Handler

    The file handler outputs log messages to the file.

    The following describes the configuration items.

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

    LevelLevel 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 RotationOption for a handler to use the log file rotation function. The rotation function is enabled by default. (default value: true)
    Rotation CountRotation 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 SizeUsed when a handler outputs files based on size. Only applies when a handler uses the log file rotation function.
    EncodingEncoding of handler's string output. The default value is system encoding.
    Filter ClassUsed 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)

    • true: Append to the existing file.

    • false: Depends on whether rotation is used. If rotation is used, then the existing log file is backed up and a new log file is created at server startup. Otherwise, the previous log file is deleted at server startup.

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

  • SMTP Handler

    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.

    ItemDescription
    NameName 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.
    LevelLevel 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 AddressHost address of the e-mail recipient.
    From AddressE-mail sender address.
    Sender IDSender ID.
    Sender PasswordSender password. To encrypt and save it, use the format "{algorithm to be encrypted) encrypted algorithm".
    To AddressAddress of the e-mail recipient.
    PropertyThere 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 MessagesOption 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)
    EncodingEncoding of handler's string output. The default value is system encoding.
    Filter ClassUsed 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 AddressAddresses of the recipients who will receive a copy of the e-mail.
    Bcc AddressAddresses of the recipients who will receive a copy of the e-mail and whose addresses will be concealed.
  • Socket Handler

    The socket handler sends log messages to the socket.

    The following table describes the socket handler's configuration items.

    ItemDescription
    NameSpecifies 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.
    LevelLevel 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.
    AddressIP address of the server that the handler accesses.
    PortPort number of the machine that the handler accesses.
    EncodingEncoding of handler's string output. The default value is system encoding.
    Filter ClassUsed 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.
  • User Handler

    The user handler specifies a user-defined handler class.

    The following describes the configuration items.

    ItemDescription
    NameHandler name. The name must be unique within each logger. If not set, a combination of the class name and hash code is used.
    LevelLevel 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 ClassUser-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 PropertyProperties to include in the map objects that are used in the setProperty() method of jeus.util.logging.JeusHandler.
    Formatter ClassFormatter 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 PropertyProperties to include in the map objects that are used in the setProperty() method of jeus.util.logging.JeusFormatter.
    EncodingEncoding of handler's string output. The default value is system encoding.
    Filter ClassUsed 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.

8.3.5. Log File Rotation Configuration

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.

[Figure 8.13] Configuring Log File Rotation in WebAdmin

Configuring Log File Rotation in WebAdmin

8.3.6. Property Configuration

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>

Note

The jeuslogging.properties file used in JEUS 6 cannot be used in JEUS 7.

Level Configuration Priority

The following is the priority of level configurations apart from the dynamic configurations set by using JEUS tool.

  1. System properties

  2. Java logging.properties file

  3. Logging configuration in domain.xml

Note

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.