Java Platform, Enterprise Edition (Java EE) 8
The Java EE Tutorial
This section explains how to determine what is causing an error in your application deployment or execution.
One way to debug applications is to look at the server log in
domain-dir`/logs/server.log`. The log contains output from 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
and from web components with the
If you use NetBeans IDE, logging output appears in the Output window as well as the server log.
If you start 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 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
Select the GlassFish Server node.
Click View Log Files.
The log viewer opens and displays the last 40 entries.
To display other entries, follow these steps:
Click Modify Search.
Specify any constraints on the entries you want to see.
Click Search at the top of the log viewer.
GlassFish Server supports the Java Platform Debugger Architecture (JPDA). With JPDA, you can configure GlassFish Server to communicate debugging information using a socket.
Follow these steps to enable debugging in GlassFish Server using the Administration Console:
Expand the Configurations node, then expand the server-config node.
Select the JVM Settings node. The default debug options are set to:
As you can see, the default debugger socket port is 9009. You can change it to a port not in use by GlassFish Server or another service.
Select the Debug Enabled check box.
Stop GlassFish Server and then restart it.