Sun GlassFish Enterprise Server v3 Prelude Administration Guide

About Logging

Logging is the process by which Enterprise Server captures data about events that occur during Enterprise Server operation. This data is recorded in a log file and is usually the first source of information when Enterprise Server problems occur.

Although application components can use the Apache Commons Logging Library to record messages, the platform standard JSR 047 API is recommended for better log configuration.

The following topics are addressed here:

Log File

Enterprise Server log records are captured in the server.log file, typically located in domain-dir/logs. You can change the default name or location of the log file by following instructions in To Change the Log File Name or Directory.

Enterprise Server log records follow a uniform format:




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

An example log record might look like this:

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

Configuration File

You can configure logging by editing the logging.properties file. The default logging.properties file is located in the same directory as the domain.xml file, typically domain-dir/config. You can choose a different file name by using the java.util.logging.config.file system property to specify a file name. For example:


 java -Djava.util.logging.config.file=myfile

Logger Namespaces

A logger is provided for each Enterprise Server module. The following table lists the names of the modules and the namespace for each logger.

Table 9–1 Logger Namespaces for Enterprise Server Modules

Module Name 

Namespace 

Admin 

javax.enterprise.system.tools.admin

Classloader 

javax.enterprise.system.core.classloading

Configuration 

javax.enterprise.system.core.config

Deployment 

javax.enterprise.system.tools.deployment

Persistence 

oracle.toplink.essentials, javax.enterprise.resource.jdo, javax.enterprise.system.container.cmp

Root 

javax.enterprise

Security 

javax.enterprise.system.core.security

Util 

javax.enterprise.system.util

Verifier 

javax.enterprise.system.tools.verifier

Web container 

javax.enterprise.system.container.web org.apache.catalina org.apache.coyote org.apache.jasper