Sun GlassFish Enterprise Server v2.1.1 Administration Guide

Chapter 17 Configuring Logging

This chapter briefly describes how to configure logging and view the server log. It contains the following sections:

About Logging

Log Records

The Enterprise Server uses the Java EE platform Logging API specified in JSR 047. Enterprise Server logging messages are recorded in the server log, normally found at domain-dir/logs/server.log. When a log is rotated, Enterprise Server creates a new, empty file named server.log and renames the old file server.log_date, where date is the date and time when the file was rotated.

The components of the Enterprise Server generate logging output. Application components can also generate logging output.

Application components may use the Apache Commons Logging Library to log messages. The platform standard JSR 047 API, however, is recommended for better log configuration.

Log records follow a uniform format:

[#|yyyy-mm-ddThh:mm:ss.SSS-Z|Log Level|ProductName-Version|LoggerName|Key Value Pairs|Message|#]

For example:

[#|2006-10-21T13:25:53.852-0400|INFO|sun-appserver9.1|javax.enterprise.
system.core|_ThreadID=13;|CORE5004: Resource Deployed: 
[cr:jms/DurableConnectionFactory].|#]

In this example,

The log record format might be changed or enhanced in future releases.

Module Log Levels

The Enterprise Server provides a logger for each of its modules.


asadmin> get server-config.log-service.module-log-levels.*
server-config.log-service.module-log-levels.admin = INFO
server-config.log-service.module-log-levels.classloader = INFO
server-config.log-service.module-log-levels.cmp = INFO
server-config.log-service.module-log-levels.cmp-container = INFO
server-config.log-service.module-log-levels.configuration = INFO
server-config.log-service.module-log-levels.connector = INFO
server-config.log-service.module-log-levels.corba = INFO
server-config.log-service.module-log-levels.deployment = INFO
server-config.log-service.module-log-levels.ejb-container = INFO
server-config.log-service.module-log-levels.group-management-service = INFO
server-config.log-service.module-log-levels.javamail = INFO
server-config.log-service.module-log-levels.jaxr = INFO
server-config.log-service.module-log-levels.jaxrpc = INFO
server-config.log-service.module-log-levels.jdo = INFO
server-config.log-service.module-log-levels.jms = INFO
server-config.log-service.module-log-levels.jta = INFO
server-config.log-service.module-log-levels.jts = INFO
server-config.log-service.module-log-levels.management-event = INFO
server-config.log-service.module-log-levels.mdb-container = INFO
server-config.log-service.module-log-levels.naming = INFO
server-config.log-service.module-log-levels.node-agent = INFO
server-config.log-service.module-log-levels.resource-adapter = INFO
server-config.log-service.module-log-levels.root = INFO
server-config.log-service.module-log-levels.saaj = INFO
server-config.log-service.module-log-levels.security = INFO
server-config.log-service.module-log-levels.self-management = INFO
server-config.log-service.module-log-levels.server = INFO
server-config.log-service.module-log-levels.synchronization = INFO
server-config.log-service.module-log-levels.util = INFO
server-config.log-service.module-log-levels.verifier = INFO
server-config.log-service.module-log-levels.web-container = INFO

Configuring Logging

This section contains the following topics:

Configuring General Logging Settings

To configure the general logging settings using the Admin Console:

On the General page, enter appropriate values to customize logging to your requirements. Stop and restart the Enterprise Server.

For details on setting the various configuration parameters, click Help in the Admin Console.

To configure these log settings in asadmin, use the get and set commands.

Configuring Log Levels

To configure log levels using the Admin Console:

Set the log level for the modules listed on this page. Use the Additional Properties area to configure log levels for any application loggers. For a list of the module loggers, see Module Log Levels.

For details on setting the various configuration parameters, click Help in the Admin Console.

To configure these log settings in asadmin, use the get and set commands.

For example, to set the logging level of the SIP container to FINE, use the following set command:

asadmin set server-config.log-service.module-log-levels.property.sip=FINE

Viewing Server Logs

To view the log files:

Use the options provided in the Search Criteria area to display log results based on your preferences.