Diagnostics Tool

Payara Server has a diagnostic tool that on demand collects the following information from the server runtime.

  • domain.xml configuration file

  • Server logs

  • Notification logs

  • Access logs

  • A JVM thread dump.

  • A JVM Heap Dump

  • JVM Report

The collection of this data can be targeted towards specific a specific server instance, deployment group or cluster. By default, everything is collected from the DAS, each instance, deployment group and cluster configured in the domain.

If the target(s) is(are) offline, only the domain.xml configuration file, server, access and notification logs will be collected.

If you are not using the default domain1, you must specify the domain to collect diagnostics from.
The diagnostics tool can be manually upgraded to a newer version in case it is needed. To do so, download the latest 1.x JAR release from Nexus using this link and then replace the older version into your Payara Server installation under the as-install/glassfish/lib/asadmin folder.

Usage

The diagnostic tool can be used through the collect-diagnostics Asadmin CLI subcommand, which will collect the relevant data and store it locally in a ZIP bundle that can be used for troubleshooting purposes when raising support tickets on the support portal.

Using this command will allow both customers and support staff to work faster on the investigation and analysis of production and development incidents.

The --obfuscate parameter will hide sensitive data in the domain.xml such as passwords, addresses and hostnames.
Use it if you’re afraid of sensitive data being shared along with the domain configuration.
The data collected is stored in a ZIP file in your user home directory, the output directory by default.
asadmin> collect-diagnostics --serverlog={true|false} --domainxml={true|false} --threaddump={true|false} --heapdump={true|false} --jvmreport={true|false} --domaindir domaindir --nodedir nodedir --dir dir --target target-name domainname

Command Options

Option Type Description Default Mandatory

--accesslog

Boolean

Whether to collect access logs.

true

no

--notificationlog

Boolean

Whether to collect notification logs.

true

no

--serverlog

Boolean

Whether to collect server logs.

true

no

--domainxml

Boolean

Whether to collect the domain.xml configuration file.

true

no

--threaddump

Boolean

Whether to collect a thread dump.

true

no

--heapdump

Boolean

Whether to collect a heap dump.

true

no

--jvmreport

Boolean

Whether to collect the JVM report.

true

no

--obfuscate

Boolean

Whether to obfuscate data in domain.xml.

true

no

--domaindir

String

The path to the directory containing the target domain.

$+{installDir}+/glassfish/domains

no

--nodedir

String

The path to the node directory containing the target instance.

$+{installDir}+/glassfish/nodes

no

--dir

String

The directory path where the ZIP file will be stored.

{user.home}

no

--target

String

The name of an instance, cluster or deployment group.

domain

no

--domainname (primary)

String

The name of the domain you would like to collect diagnostics for.

domain1

no

The resulting compressed ZIP file will have a directory structure similar to the following:

deploymentGroup1
├── instance1
│   ├── instance1-domain.xml
│   ├── instance1-jvm-report.txt
│   ├── instance1-server.log
|   ├── instance1-notification.log
│   ├── instance1-server_access_log.txt
│   └── instance1-thread-dump.txt
└── instance2
    ├── instance2-domain.xml
    ├── instance2-jvm-report.txt
    ├── instance2-server.log
    ├── instance2-notification.log
    ├── instance2-server_access_log.txt
    └── instance2-thread-dump.txt

Where the data is grouped in sub-folders segregated in all targets (deployment groups, clusters and instances) scanned by the command.

Example

The following example shows how to collect the data of all instances that belong to the deploymentGroup1 deployment group in the mydomain domain:

asadmin> collect-diagnostics --target deploymentGroup1 mydomain

Directory selected /home/user/payara/diagnostics/mydomain-2024-04-15T11-42-36Z
Collecting domain.xml from instance2
Attempting to create missing path at /home/user/payara/diagnostics/mydomain-2024-04-15T11-42-36Z/deploymentGroup1/instance1
Obfuscating /home/user/payara/diagnostics/mydomain-2024-04-15T11-42-36Z/deploymentGroup1/instance1
Successfully obfuscated /home/user/payara/diagnostics/mydomain-2024-04-15T11-42-36Z/deploymentGroup1/instance1
Collecting logs from instance2
Collecting jvm report from instance2
Collecting thread dump from instance2
Collecting Heap Dump from instance2
This version of Payara does not support heap dump generation.
Collecting domain.xml from instance1
Attempting to create missing path at /home/user/payara/diagnostics/mydomain-2024-04-15T11-42-36Z/deploymentGroup1/instance1
Obfuscating /home/user/payara/diagnostics/mydomain-2024-04-15T11-42-36Z/deploymentGroup1/instance1
Successfully obfuscated /home/user/payara/diagnostics/mydomain-2024-04-15T11-42-36Z/deploymentGroup1/instance1
Collecting logs from instance1
Collecting jvm report from instance1
Collecting thread dump from instance1
Collecting Heap Dump from instance1

Command collect-diagnostics executed successfully.

Remote Collection

Collect Diagnostics with an unavailable DAS

Diagnostics can be collected directly from a running instance in case its corresponding DAS it’s not available by specifying the admin port of the target instance (by using the -p|--port asadmin options), like this:

asadmin> -p 24848 collect-diagnostics --target deploymentGroup1 mydomain
This command must be run locally on the host of the node where this instance is located.