JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle GlassFish Server 3.1 Administration Guide
search filter icon
search icon

Document Information

Preface

1.  Overview of GlassFish Server Administration

Default Settings and Locations

Configuration Tasks

Administration Tools

Instructions for Administering GlassFish Server

Part I Runtime Administration

2.  General Administration

3.  Administering Domains

4.  Administering the Virtual Machine for the Java Platform

5.  Administering Thread Pools

6.  Administering Web Applications

7.  Administering the Logging Service

About Logging

Log Files

Log File Names and Locations

Log Records

Log Rotation

Logger Namespaces

Logging Targets

Logging Properties

Configuring the Logging Service

Changing the Name and Location of Logging Service Files

To Change the Name and Location of the Log File

To Change the Name and Location of the Logging Properties File

Setting Log Levels

To List Log Levels

To Set the Global Log Level

To Set Module Log Levels

Setting Log File Rotation

To Change the Rotation File Size

To Change the File Rotation Interval

To Change the Limit Number of Retained Files

To Rotate Log Files Manually

Adding a Custom Logging Handler

To Add a Custom Log Handler

Viewing Log Records

To Collect Log Files into a ZIP Archive

8.  Administering the Monitoring Service

9.  Writing and Running JavaScript Clients to Monitor GlassFish Server

10.  Administering Life Cycle Modules

11.  Extending and Updating GlassFish Server

Part II Resources and Services Administration

12.  Administering Database Connectivity

13.  Administering EIS Connectivity

14.  Administering Internet Connectivity

15.  Administering the Object Request Broker (ORB)

16.  Administering the JavaMail Service

17.  Administering the Java Message Service (JMS)

18.  Administering the Java Naming and Directory Interface (JNDI) Service

19.  Administering Transactions

Part III Appendixes

A.  Subcommands for the asadmin Utility

Index

About Logging

Logging is the process by which Oracle GlassFish Server captures information about events that occur, such as configuration errors, security failures, or server malfunction. This data is recorded in log files and is usually the first source of information when problems occur. Analyzing the log files can help you to determine the health of the server.

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 Files

Oracle GlassFish Server log records are captured in one of two general types of log files:

The following topics are addressed here:

Log File Names and Locations

In an Oracle GlassFish Server domain, log files have the following names and locations by default:

Instance
Default Log File Name and Location
DAS
domain-dir/logs/server.log
Each server instance
instance-dir/logs/server.log
Cluster instance
instance-dir/logs/cluster.log

For example, in a domain hosted on a given machine that includes a cluster with two managed servers (ClusterServer1 and ClusterServer1) and a standalone instance (StandaloneServer), the log files might be arranged in the following directory structure. In this directory structure, the server.log file for the DAS is located in domain-dir/logs.

as-install-parent directory
     glassfish/
         domains/
             domain-name/
                         logs/
                            server.log
         nodes/
             hostname/
                         ClusterServer1/
                                      logs/
                                         server.log
                                         cluster.log
                         ClusterServer2/
                                      logs/
                                         server.log
                                         cluster.log
                         StandaloneServer/
                                      logs/
                                         server.log

You can change the default name or location of a log file by modifying the logging properties file for the corresponding instance, described in To Change the Name and Location of the Log File.

Log Records

Oracle GlassFish Server log records follow a uniform format:

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

The following is an example of a log record:

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

The Administration Console presents log records in a more readable display.

Log Rotation

By default, when a log file grows to 2 MB, Oracle GlassFish Server renames (rotates) the file to incorporate a timestamp and creates a new log file. The log file is renamed as log-type.log_date, where log-type represents either server or cluster, and date represents the time of rotation.

You can configure the logging service to change the default settings for log file rotation, as explained in Setting Log File Rotation.

Logger Namespaces

Oracle GlassFish Server provides a logger for each of its modules. The following list is an example of the logger namespaces in a server instance as they appear when using the list-log-levels subcommand.

java.util.logging.ConsoleHandler     <FINEST>
javax.enterprise.resource.corba     <INFO>
javax.enterprise.resource.javamail  <INFO>
javax.enterprise.resource.jdo       <INFO>
javax.enterprise.resource.jms       <INFO>
javax.enterprise.resource.jta       <INFO>
javax.enterprise.resource.resourceadapter     <INFO>
javax.enterprise.resource.sqltrace  <INFO>
javax.enterprise.resource.webcontainer.jsf.application  <INFO>
javax.enterprise.resource.webcontainer.jsf.config       <INFO>
javax.enterprise.resource.webcontainer.jsf.context      <INFO>
javax.enterprise.resource.webcontainer.jsf.facelets     <INFO>
javax.enterprise.resource.webcontainer.jsf.lifecycle    <INFO>
javax.enterprise.resource.webcontainer.jsf.managedbean  <INFO>
javax.enterprise.resource.webcontainer.jsf.renderkit    <INFO>
javax.enterprise.resource.webcontainer.jsf.resource     <INFO>
javax.enterprise.resource.webcontainer.jsf.taglib       <INFO>
javax.enterprise.resource.webcontainer.jsf.timing       <INFO>
javax.enterprise.system.container.cmp         <INFO>
javax.enterprise.system.container.ejb         <INFO>
javax.enterprise.system.container.ejb.mdb     <INFO>
javax.enterprise.system.container.web         <INFO>
javax.enterprise.system.core.classloading     <INFO>
javax.enterprise.system.core.config   <INFO>
javax.enterprise.system.core.naming   <INFO>
javax.enterprise.system.core.security <INFO>
javax.enterprise.system.core.selfmanagement   <INFO>
javax.enterprise.system.core.transaction      <INFO>
javax.enterprise.system     <INFO>
javax.enterprise.system.tools.admin   <INFO>
javax.enterprise.system.tools.backup  <INFO>
javax.enterprise.system.tools.deployment      <INFO>
javax.enterprise.system.util          <INFO>
javax.enterprise.system.webservices.registry  <INFO>
javax.enterprise.system.webservices.rpc       <INFO>
javax.enterprise.system.webservices.saaj      <INFO>
javax     <INFO>
org.apache.catalina    <INFO>
org.apache.coyote      <INFO>
org.apache.jasper      <INFO>
org.jvnet.hk2.osgiadapter   <INFO>

For information about how to display logger namespaces and log levels, see To List Log Levels.

Logging Targets

Each instance in an Oracle GlassFish Server domain has a dedicated log file, and each instance and cluster has its own logging properties file. To configure logging for an instance or a cluster, Oracle GlassFish Server allows you target specific log files or logging properties files when you do the following:

The following subcommands optionally accept a target specification. A target can be a configuration name, server name, cluster name, or instance name, and is specified as either an operand or as a value passed using the --target option. If no target is specified when using any of these subcommands, the default target is the DAS.

Subcommand
Description
Target Specification
Collects all available log files into a ZIP archive.
--target=target-name
Lists logging attributes in the logging properties file.
target-name operand
Lists the loggers in the logging properties file and their log levels.
target-name operand
Rotates the log file by renaming it and creating a new log file to store new messages.
--target=target-name
Sets the specified logging attributes in the logging properties file.
--target=target-name
Sets the log level for one or more loggers listed in the logging properties file.
--target=target-name

Logging Properties

The DAS as well as each configuration, instance, and cluster has its own set of logging properties that are maintained in individual configuration files. A logging properties file is named logging.properies and includes the following information:

By default in an Oracle GlassFish Server domain, logging properties files are created in the following locations:

Target
Default Location of Logging Properties File
DAS
domain-dir/config/logging.properties
A configuration
domain-dir/config/config-name/logging.properties, where config-name represents the name of a configuration that is shared by one or more instances or clusters.
An instance
domain-dir/config/instance-name-config/logging.properties, where instance-name represents the name of the instance.
A cluster
domain-dir/config/cluster-name-config/logging.properties, where cluster-name represents the name of the cluster.

For information about configuring logging properties, see Configuring the Logging Service.