Java Reference
In-Depth Information
Using the Server Log
One way to debug applications is to look at the server log in domain-dir /logs/serv-
er.log . The log contains output from the GlassFish Server and your applications. You
can log messages from any Java class in your application with System.out.println
and the Java Logging APIs (documented at http://docs.oracle.com/javase/
6/docs/technotes/guides/logging/index.html ) and from web compon-
ents with the ServletContext.log method.
If you use NetBeans IDE, logging output appears in the Output window as well as the
server log.
If you start the GlassFish Server with the --verbose flag, all logging and debugging
output will appear on the terminal window or command prompt and the server log. If you
start the GlassFish Server in the background, debugging information is available only in
the log. You can view the server log with a text editor or with the Administration Console
log viewer.
To Use the Administration Console Log Viewer
1. Select the GlassFish Server node.
2. Click the View Log Files button.
The log viewer opens and displays the last 40 entries.
3. To display other entries, follow these steps.
a. Click the Modify Search button.
b. Specify any constraints on the entries you want to see.
c. Click the Search button at the top of the log viewer.
Using a Debugger
The GlassFish Server supports the Java Platform Debugger Architecture (JPDA). With
JPDA, you can configure the GlassFish Server to communicate debugging information
using a socket.
To Debug an Application Using a Debugger
1. Enable debugging in the GlassFish Server using the Administration Console:
a. Expand the Configurations node, then expand the server-config node.
b. Select the JVM Settings node. The default debug options are set to:
-Xdebug -Xrunjd-
wp:transport=dt_socket,server=y,suspend=n,address=9009
Search WWH ::




Custom Search