Logging

This chapter describes the JEUS logging system, JEUS logger structure, log message contents, and how to set each logger and handler.

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.

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

Major Changes by Version

The following describes the major changes for each version.

  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.

    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.

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

  4. From JEUS 8.5 version, we introduce a status logger that can record an exception condition of the Asynchronous logger.

    The asynchronous logger is used to find the cause when a problem occurs in the logging operation. The status logger is not set by the user. By default, the file handler (FileHandler) logs the problem in the JeusLoggerStatus.log file when a problem occurs. If there is no problem, the JeusLoggerStatus.log file is not generated.

  5. Starting from version 8.5, JEUS supports pattern formatting, allowing users to specify the format of logs to be displayed during logging.

    This is applied to JEUS server logs, supporting 8 types of format strings (%d, %l, %J, %T, %c, %M, %N, %m). Users can combine format strings and general characters to set their desired logging pattern. However, '%' character cannot be included in the logging pattern to identify format strings.

    SimpleFormatter and SimpleMillisFormatter, which were supported by the previous versions of JEUS, can also output logs in logging patterns.

    • SimpleFormatter

      [%d{yyyy.MM.dd HH:mm:ss}][%l] [%J-%T] [%M-%N] %m
    • SimpleMillisFormatter

      [%d{yyyy.MM.dd HH:mm:ss:SSS}][%l] [%J-%T] [%M-%N] %m

      The default value of the logging pattern is the same as the logging pattern used by the existing SimpleFormatter. For more information such as format strings, refer to Checking Logger Information.

  6. Starting with JEUS version 21, the size of the buffer for storing events of the Asynchronous logger and the waiting strategy to be used by the consumer when there are no log events in the buffer can be specified as system properties.

    If you have a large amount of log events, you can increase jeus.logging.async.bufferSize to allow the event buffer to accommodate more events. The default is 2048, and the maximum is 262144.

    The waiting strategy of the log event consumer can be set via jeus.logging.async.waitStrategy. The default value is block. In addition to this, sleep, yield, busyspin, and timeout are supported.

  7. Starting with JEUS version 9, environment variables and system properties can be included in the path when setting the log-home and rotation-dir paths of each server and the file handler. Note that the variable name must be specified in the format ${VAR}.

2. Basic JEUS Logger Structure

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

2.1. Overview

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

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.

SERVER_HOME
  |--logs
       |--servlet
       |      |--access.log
       |--JeusLauncher.log
       |--JeusServer.log
       |--JeusLoggerStatus.log
       |--jvm.log

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.

JeusLoggerStatus.log

JEUS 7 Fix4 is a log file that records exceptions during the operation of the Asynchronous logger (server logger) which is set as default. The log file is only generated if an exception occurs in the Asynchronous 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. JEUS provides an option that automatically appends a time stamp to a specified log file so that the file can be identified from a gc log file created whenever JEUS starts (default). If you do not want to append a time stamp, add a JVM option called -Djeus.logging.gclog.timestamp.on=false to a startup script.

Log Directory Configuration

Edit domain.xml to set a log directory to save all logs created on the server (including rotation backup logs) as in the following example.

<servers>
        <server>
            <name>server1</name>
            <node-name>node1</node-name>
            <log-home>${LOG_HOME}/logs</log-home>
                ...

You can put the value of a system environment variable or system property in the log-home path. Here, the variable name must be a pattern such as ${ENV_NAME}, and if an unregistered environment variable is used, the log is created in the default path.

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 Launcher in JEUS Server Guide.

The following is an example of a log message left by the launcher when the boot fails due to a 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)

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 a format pattern. When there is no specific configuration applied, you can use the default format pattern provided by JEUS, which is '[%d{yyyy.MM.dd HH:mm:ss}][%l] [%J-%T] [%M-%N] %m'.

The following are the logging patterns of SimpleFormatter and SimpleMillisFormatter, which are formatters supported in previous versions.

  • SimpleFormatter

    [%d{yyyy.MM.dd HH:mm:ss}][%l] [%J-%T] [%M-%N] %m
  • SimpleMillisFormatter

    [%d{yyyy.MM.dd HH:mm:ss:SSS}][%l] [%J-%T] [%M-%N] %m

The following describes the format of the server logger.

  • Log format

    [%d{yyyy.MM.dd HH:mm:ss}] [%l] [%J-%T] [%M-%N] %m
    Item Description

    %d{yyyy.MM.dd HH:mm:ss}

    Displays the date of a log event. Enter the DATE_FORMAT inside '{}' to specify the format of the date you want to display. The DATE_FORMAT is formatted according to the JDK’s SimpleDateFormat.

    %l

    Each log level of the log event is displayed as a number mapped to it.

    • 0 : SEVERE

    • 1 : WARNING

    • 2 : INFO

    • 3 : CONFIG

    • 4 : FINE

    • 5 : FINER

    • 6 : FINEST

    • 7 : ALL

    %J

    Displays the process of logging the message. It represents the thread information.

    %T

    Displays the thread number that logs the message. Log messages with the same thread information are logged by the same thread.

    %M

    Displays the name of the module that outputs the log. Refer to Log Messages with Module Names for the name of each module.

    %N

    Displays the message number of the output log event.

    %m

    Contains activities on the server while it is running.

    %c

    Displays the name of the logger that logs the message.

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.

[2024.09.25 16:01:33][2] [ms1-1] [SERVER-0248] The JEUS server is STARTING.
[2024.09.25 16:01:34][0] [ms1-1] [SERVER-0000] Version information - JEUS 9 (9.0.0.0-b15).
[2024.09.25 16:01:34][0] [ms1-1] [SERVER-0001] java.specification.version=[17], java.runtime.version=[17.0.2+8-86], vendor=[Oracle Corporation]
[2024.09.25 16:01:34][2] [ms1-1] [SERVER-0003] os.name=[linux], os.arch=[amd64], os.version=[4.18.0-408.el8.x86_64]
[2024.09.25 16:01:34][2] [ms1-1] [SERVER-0002] Domain=[domain1], Server=[ms1], baseport=[19736], pid=[17004]
[2024.09.25 16:01:34][2] [ms1-1] [SERVER-0004] The current system time zone : KST
[2024.09.25 16:01:34][2] [ms1-1] [SERVER-0571] All JEUS system properties have been confirmed.
[2024.09.25 16:01:34][2] [ms1-1] [SERVER-0568] Service address='0.0.0.0:19736', hostname='JEUS-PC', representation ip='192.168.1.105'
[2024.09.25 16:01:34][2] [ms1-1] [SERVER-0561] The default RMI export port = 19743 and bind address = JEUS-PC/192.168.1.105.
[2024.09.25 16:01:34][2] [ms1-1] [NET-0002] Beginning to listen to NonBlockingChannelAcceptor: 0.0.0.0:19736.

The previous example shows that the first message was output at 16:01:33 on September 25th, 2024. This message, server message number 0248, was logged by thread number 1 on the server named "ms1". It is the first message output for the server showing that JEUS server has initiated to boot.

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 JEUS version, Java version, process ID, timezone, and network information.

JEUS provides [%d{yyyy.MM.dd HH:mm:ss}] [%l] [%J-%T] [%M-%N] %m as the default format pattern of the server logger. This is the format pattern that SimpleFormatter outputs in the previous version, and the format pattern of SimpleMillisFormatter, which was provided along with SimpleFormatter in the previous version, is [%d{yyyy.MM.dd HH:mm:ss:SSS}] [%l] [%J-%T] [%M-%N] %m.

The following is an example of the log messages that are created when you set the format pattern that outputs the same log format as the SimpleMillisFormatter. For more information about the formatter configuration, refer to Logging Configuration.

[2024.09.25 16:01:33][2] [ms1-1] [SERVER-0248] The JEUS server is STARTING.
[2024.09.25 16:01:34:385][0] [ms1-1] [SERVER-0000] Version information - JEUS 9 (9.0.0.0-b15).
[2024.09.25 16:01:34:385][0] [ms1-1] [SERVER-0001] java.specification.version=[17], java.runtime.version=[17.0.2+8-86], vendor=[Oracle Corporation]
[2024.09.25 16:01:34:386][2] [ms1-1] [SERVER-0003] os.name=[linux], os.arch=[amd64], os.version=[4.18.0-408.el8.x86_64]
[2024.09.25 16:01:34:387][2] [ms1-1] [SERVER-0002] Domain=[domain1], Server=[ms1], baseport=[19736], pid=[17004]
[2024.09.25 16:01:34:387][2] [ms1-1] [SERVER-0004] The current system time zone : KST
[2024.09.25 16:01:34:560][2] [ms1-1] [SERVER-0571] All JEUS system properties have been confirmed.
[2024.09.25 16:01:34:568][2] [ms1-1] [SERVER-0568] Service address='0.0.0.0:19736', hostname='JEUS-PC', representation ip='192.168.1.105'
[2024.09.25 16:01:34:580][2] [ms1-1] [SERVER-0561] The default RMI export port = 19743 and bind address = JEUS-PC/192.168.1.105.
[2024.09.25 16:01:35:030][2] [ms1-1] [NET-0002] Beginning to listen to NonBlockingChannelAcceptor: 0.0.0.0:19736.

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.

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 above log means that the request to /example/test1.jsp from 192.168.15.57 successfully sent a 38-byte response at 29/Aug/2016:17:37:02 +0900. For more detailed log format, please refer to the documentation on common log formats.

For more information on changing the format of the recorded log or configuring other web engine access loggers, see Access Log Settings in JEUS Web Engine Guide.

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.

2.6. Logger List

The following describes loggers.

  • EJB loggers

    Division 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

    Division 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

    Division 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

    Division 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

      Division 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

      Division 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)

      Division Description

      jeus.webservices.wss

      ws-security logger

    • Others

      Division Description

      jeus.xml.binding.webservicesHelper

      Logger for DD binding used in EWS (JSR109)

  • Transaction logger

    Division 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

    Division 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

    Division Description

    jeus.classloader

    JEUS class loading logger

    jeus.clustering

    JEUS server cluster logger

    jeus.config

    Logger for changing dynamic configurations of JEUS

    jeus.connector

    Jakarta EE 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

    jeus.logger.status

    Logger for JEUS Asynchronous logger (server logger) exceptions

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

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

OTS

OTS

SCF

SCF(JEUS System Clustering Framwork)

Scheduler

Scheduler

Secutiry

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

3. Logging Configuration

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

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.

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 to check for information about jeus logger, the default logger on the server.

Using the Console Tool

You can check information about the jeus logger and its registered handlers by executing the log-level and list-log-handlers commands in the console tool as follows. For detailed information on how to use each command, see Server Management Commands in JEUS Reference Guide.

[MASTER]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@1698156408 | ConsoleHandler | ALL           |
| FileHandler                                 | FileHandler    | FINEST        |
+---------------------------------------------+----------------+---------------+
================================================================================

[MASTER]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           | [%d{yyyy.MM.dd HH:mm:ss}] [%l] [%J-%T] [%M-%N] %m      |
+---------------------+--------------------------------------------------------+
================================================================================

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

3.2. Dynamically Configuring a Logger

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

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.For more information about these commands, see Server Management Commands in JEUS Reference Guide.

The currently configured logger information can be checked by using the list-loggers command.

[MASTER]domain1.adminServer>list-loggers server1
List of Loggers
================================================================================
+-------------+-------+---------------+--------+-------------------------------+
| Logger Name | Level |   Use Parent  | Filter |           Formatter           |
|             |       |   Handlers    |        |                               |
+-------------+-------+---------------+--------+-------------------------------+
| jeus        | INFO  | false         |        | [%d{yyyy.MM.dd HH:mm:ss}][%l] |
|             |       |               |        | [%J-%T] [%M-%N] %m            |
+-------------+-------+---------------+--------+-------------------------------+
================================================================================

[MASTER]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".

[MASTER]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".

[MASTER]domain1.adminServer>list-loggers server1
List of Loggers
================================================================================
+--------------+--------+--------------+--------+------------------------------+
|  Logger Name |  Level |  Use Parent  | Filter |           Formatter          |
|              |        |   Handlers   |        |                              |
+--------------+--------+--------------+--------+------------------------------+
| jeus         | INFO   | false        |        | [%d{yyyy.MM.dd               |
|              |        |              |        |HH:mm:ss}][%l] [%J-%T]        |
|              |        |              |        |[%M-%N] %m                    |
+--------------+--------+--------------+--------+------------------------------+
| jeus.ejb     | FINEST | true         |        | [%d{yyyy.MM.dd               |
|              |        |              |        |HH:mm:ss}][%l] [%J-%T]        |
|              |        |              |        |[%M-%N] %m                    |
+--------------+--------+--------------+--------+------------------------------+
| jeus.ejb.clu | FINEST | true         |        | [%d{yyyy.MM.dd               |
|stering       |        |              |        |HH:mm:ss}][%l] [%J-%T]        |
|              |        |              |        |[%M-%N] %m                    |
+--------------+--------+--------------+--------+------------------------------+
================================================================================

[MASTER]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".

[MASTER]domain1.adminServer>list-loggers server1
List of Loggers
================================================================================
+--------------+--------+--------------+--------+------------------------------+
|  Logger Name |  Level |  Use Parent  | Filter |           Formatter          |
|              |        |   Handlers   |        |                              |
+--------------+--------+--------------+--------+------------------------------+
| jeus         | INFO   | false        |        | [%d{yyyy.MM.dd               |
|              |        |              |        |HH:mm:ss}][%l] [%J-%T]        |
|              |        |              |        |[%M-%N] %m                    |
+--------------+--------+--------------+--------+------------------------------+
| jeus.ejb     | FINEST | true         |        | [%d{yyyy.MM.dd               |
|              |        |              |        |HH:mm:ss}][%l] [%J-%T]        |
|              |        |              |        |[%M-%N] %m                    |
+--------------+--------+--------------+--------+------------------------------+
| jeus.ejb.clu | FINE   | true         |        | [%d{yyyy.MM.dd               |
|stering       |        |              |        |HH:mm:ss}][%l] [%J-%T]        |
|              |        |              |        |[%M-%N] %m                    |
+--------------+--------+--------------+--------+------------------------------+
================================================================================

[MASTER]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".

[MASTER]domain1.adminServer>list-loggers server1
List of Loggers
================================================================================
+--------------+-------+--------------+--------+-------------------------------+
|  Logger Name | Level |  Use Parent  | Filter |           Formatter           |
|              |       |   Handlers   |        |                               |
+--------------+-------+--------------+--------+-------------------------------+
| jeus         | INFO  | false        |        | [%d{yyyy.MM.dd HH:mm:ss}][%l] |
|              |       |              |        | [%J-%T] [%M-%N] %m            |
+--------------+-------+--------------+--------+-------------------------------+
| jeus.ejb.clu | FINE  | true         |        | [%d{yyyy.MM.dd HH:mm:ss}][%l] |
|stering       |       |              |        | [%J-%T] [%M-%N] %m            |
+--------------+-------+--------------+--------+-------------------------------+
================================================================================

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 the console tool.

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.

[MASTER]domain1.adminServer>modify-server server1
Shows the current configuration.
server (server1)
================================================================================
+--------------------------------+---------------------------------------------+
| JVM Configs                    | -Xmx1024m -XX:MaxMetaspaceSize=512m         |
| Action On Resource Leak        | WARNING                                     |
| Stdout to Raw Format           | true                                        |
| MEJB                           | false                                       |
| Class FTP                      | false                                       |
| Server Log Home Directory      | none                                        |
+--------------------------------+---------------------------------------------+
================================================================================

[MASTER]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".

[MASTER]domain1.adminServer>list-servers server1
List of Editable Servers
================================================================================
+-----+--------+-----+---------+---------+---------+-----+-----+---------+-----+
| Ser |  Base  | Node|   JVM   |  Action |  Stdout | MEJB| Cla |  Server | Type|
| ver | Listen |     | Configs |   On    | to Raw  |     | ss  |Log Home |     |
|     |Address |     |         |Resource | Format  |     | FTP | Directo |     |
|     | /Port  |     |         |   Leak  |         |     |     |   ry    |     |
+-----+--------+-----+---------+---------+---------+-----+-----+---------+-----+
| ser |0.0.0.0 |     | -Xmx102 | Warning | false   | fal | fal | none    | ser |
|ver1 |/ 9836  |     |4m       |         |         |se   |se   |         |ver  |
|     |        |     |-XX:MaxM |         |         |     |     |         |     |
|     |        |     |etaspace |         |         |     |     |         |     |
|     |        |     |Size=512m|         |         |     |     |         |     |
+-----+--------+-----+---------+---------+---------+-----+-----+---------+-----+
================================================================================

The standard output uses the following format.

[%d{yyyy.MM.dd HH:mm:ss}] [%l] [%J-%T] [%M-%N] [STDOUT/STDERR] %m
Item Description

%d{yyyy.MM.dd HH:mm:ss}

Displays the date of a log event. Enter the DATE_FORMAT inside '{}' to specify the format of the date you want to display. The DATE_FORMAT is formatted according to the JDK’s SimpleDateFormat.

%l

Each log level of the log event is displayed as a number mapped to it.

  • 0 : SEVERE

  • 1 : WARNING

  • 2 : INFO

  • 3 : CONFIG

  • 4 : FINE

  • 5 : FINER

  • 6 : FINEST

  • 7 : ALL

%J

Displays the process of logging the message. It represents the thread information.

%T

Displays the thread number that logs the message. Log messages with the same thread information are logged by the same thread.

%M

Displays the name of the module the outputs the log. Refer to Log Messages with Module Names for the name of each module.

%N

Displays the message number of the output log event.

%m

Message to be output through System.out or System.err. If it is a log for standard output or standard error, the message is output with prefixes such as [STDOUT] or [STDERR] in front of it.

  • STDOUT: When the message is standard output.

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

  • UNKNOWN: Unknown.

%c

Displays the name of the logger that logs the message.

3.4. Logger Settings

Loggers and handlers can be added, deleted, or modified by using 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.

Adding Logger

You can add a logger or query the loggers in use using the console tool as follows:

[MASTER]domain1.adminServer>add-logger logger2 -level SEVERE -useParentHandlers false -server server1
Successfully performed the ADD operation for The logger for the server(server1)., but all changes were non-dynamic. They will be applied after restarting.
Check the results using "list-loggers or add-logger".
[MASTER]domain1.adminServer>list-loggers server1
List of Loggers
================================================================================
+-------------+--------+---------------+--------+------------------------------+
| Logger Name |  Level |   Use Parent  | Filter |           Formatter          |
|             |        |   Handlers    |        |                              |
+-------------+--------+---------------+--------+------------------------------+
| jeus        | INFO   | false         |        | [%d{yyyy.MM.dd               |
|             |        |               |        |HH:mm:ss}][%l] [%J-%T]        |
|             |        |               |        |[%M-%N] %m                    |
+-------------+--------+---------------+--------+------------------------------+
| logger2     | SEVERE | false         |        | [%d{yyyy.MM.dd               |
|             |        |               |        |HH:mm:ss}][%l] [%J-%T]        |
|             |        |               |        |[%M-%N] %m                    |
+-------------+--------+---------------+--------+------------------------------+
================================================================================

The following describes the configuration items.

Item Description

server-name

Name of the server to which to add the logger.

logger-name

Logger name.

log-level

Logger level. Only messages at or below this level is output through the logger.

  • SEVERE

  • WARNING

  • INFO (default value)

  • CONFIG

  • FINE

  • FINER

  • FINEST

  • ALL

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

Format Pattern used by the logger to format log messages before sending them to a handler.

(Default: [%d{yyyy.MM.dd HH:mm:ss}] [%l] [%J-%T] [%M-%N] %m)

The log levels FATAL, NOTICE, INFORMATION, and DEBUG used in JEUS 4x are not available in JEUS 7.

Adding Handler

Handlers include the file handler, SMTP handler, socket handler, and user handler. The following are the configuration items of each handler.

  • File Handler

    A file handler is a handler that outputs log messages to a file. It can be added using the jeusadmin command as follows:

    [MASTER]domain1.adminServer>add-handler handler2 -server server1 -logger logger2 -level FINEST -filename logFile2.log -enable false -day 1
    Successfully performed the ADD operation for The handler for the logger(logger2) on the server(server1)., but all changes were non-dynamic. They will be applied after restarting.
    Check the results using "list-log-handlers or add-log-handler".
    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 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.

    Log chown

    Sets the owner and owner group of the log files. Enter the owner and owner group in order, separated by a comma (,).

    Log Permission

    Access permissions for the log file. Use 9 characters made up of r, w, x, and -. (This option is valid only for Unix OS)

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

    • true: Append to the existing file. (Default value)

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

    Used only when the handler uses log file rotation.

    You can specify the path using the system environment variables or system properties. For example, you can set the path as <rotation-dir>${JEUS_HOME}/rotatedLog/${jeus.server.name}</rotation-dir>.

    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: kilobytes)

    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.

    To add a handler other than the file handler, you must set the jeus.logging.useAsync option to false, and you can add it by editing domain.xml as follows:

    <smtp-handler>
        <name>smtphandler</name>
        <level>WARNING</level>
        <smtp-host-address>gw.tmaxsoft.com</smtp-host-address>
        <sender-id>sender@tmaxsoft.com</sender-id>
        <sender-password>1234567</sender-password>
        <from-address>sender@tmaxsoft.com</from-address>
        <to-address>receiver@tmaxsoft.com</to-address>
        <property>
            <key>mail.smtp.socketFactory.port</key>
            <value>465</value>
        </property>
        <property>
            <key>mail.smtp.socketFactory.class</key>
            <value>javax.net.ssl.SSLSocketFactory</value>
        </property>
        <property>
            <key>mail.smtp.auth</key>
            <value>true</value>
        </property>
        <send-for-all-messages>true</send-for-all-messages>
    </smtp-handler>
    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

    SMTP property for a specific mail server.

    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

    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.

    Cc Address

    Addresses of the recipients to receive a carbon 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.

  • Socket Handler

    The socket handler sends log messages to the socket.

    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 which means that all log messages through the logger are output by each 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

    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.

  • User Handler

    The user handler specifies a user-defined handler class.

    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.

    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 Pattern

    Format of the log to be output. (Default: [%d{yyyy.MM.dd HH:mm:ss}] [%l] [%J-%T] [%M-%N] %m)

    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

    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.

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.

Using the Console Tool

Log file rotation settings for the file handler can be configured using the modify-log-handler command. There are three options available for rotation settings in the console tool: -hour, -size, and -day. The default is day 1.

If none of the three conditions for rotation are set, the name of the file being logged will be changed and backed up at 00:00 every day, and files logged thereafter will be newly logged to the previously logged file.

The following is an example of modifying the log rotation by using jeusadmin.

[MASTER]domain1.adminServer>modify-log-handler fileHandler -server adminServer -logger jeus -day 2
Successfully performed the MODIFY operation for The handler(fileHandler) for the logger(jeus) in server (adminServer), but all changes were non-dynamic. They will be applied after restarting.
Check the results using "modify-log-handler".

3.6. Properties

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.

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

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.