> For the complete documentation index, see [llms.txt](https://docs.sealights.io/knowledgebase/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/java-agent/command-reference.md).

# Command Reference

{% hint style="warning" %}
**Legacy Alias Deprecation Notice**

Starting with **Java Agent 4.0.2745**, SeaLights supports standardised CLI parameter naming across technologies.

Legacy parameter aliases remain supported for backward compatibility, but they are planned for future deprecation. Customers are strongly encouraged to migrate to the standardised CLI parameters as part of their regular maintenance and upgrade process. More information can be found in [**Configuration Standards**](/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/configuration-standards.md).
{% endhint %}

### Agent Files <a href="#agent-files" id="agent-files"></a>

There are two agent files:

* Build Scanner - sl-build-scanner.jar
* Test Listener - sl-test-listener.jar

Download them from: <https://agents.sealights.co/sealights-java/sealights-java-latest.zip>

## Java Agent — Command Reference <a href="#generating-a-session-id" id="generating-a-session-id"></a>

### Build Scanner - Generating a Session ID (`config`) <a href="#standard-session-id" id="standard-session-id"></a>

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

```bash
##Minimum required CLI parameters
java -jar sl-build-scanner.jar config \
  --token <token> \
  --appName <app-name> \
  --branchName <branch> \
  --buildName <build> \
  --includePackages <include> \
  --excludePackages <exclude>
```

#### All CLI Parameters

<table><thead><tr><th width="178.94921875">CLI Parameter</th><th width="249.08203125">Legacy Alias</th><th>Description</th></tr></thead><tbody><tr><td><code>--token</code></td><td><code>--token</code></td><td>Access token generated from the SeaLights server.</td></tr><tr><td><code>--tokenFile</code></td><td><code>--tokenfile</code></td><td>Path to file containing access token generated from the SeaLights server.</td></tr><tr><td><code>--appName</code></td><td><code>--appname</code></td><td>Name of the application.</td></tr><tr><td><code>--branchName</code></td><td><code>--branch</code></td><td>The source branch of the application.</td></tr><tr><td><code>--buildName</code></td><td><code>--build</code></td><td>The build label of the current build.</td></tr><tr><td><code>--includePackages</code></td><td><code>--packagesincluded</code></td><td>Comma-separated list of packages to include in scan. Supports wildcards (<code>*</code> - any string, <code>?</code> - any character). For example, <code>'com.example.* ,io.*.demo, com.?ello.world'</code>.</td></tr><tr><td><code>--excludePackages</code></td><td><code>--packagesexcluded</code></td><td>Comma-separated list of packages to exclude from scan. Supports wildcards (<code>*</code> - any string, <code>?</code> - any character). For example, <code>'com.example.* ,io.*.demo, com.?ello.world'</code>.</td></tr><tr><td><code>--buildSessionId</code></td><td><code>--buildsessionid</code></td><td>Optional: A user provided session ID (The ID must be under 40 characters length).</td></tr><tr><td><code>--buildSessionIdFile</code></td><td><code>--buildsessionidfile</code></td><td>Path to a file to save the build session id in (Default: <code>buildSessionId.txt</code>).</td></tr><tr><td><code>--failOnError</code></td><td><code>--enableNoneZeroErrorCode</code></td><td>Indicates that the Build Scanner should return with error code in case of scan failure. On: return 1, Off: return 0.</td></tr><tr><td><code>--proxy</code></td><td><code>--proxy</code></td><td>Address of proxy to run connection through.</td></tr><tr><td><code>--help</code></td><td><code>--help</code></td><td>Show Help message and exit.</td></tr><tr><td><code>--quiet</code></td><td><code>--quiet</code></td><td>Suppresses console feedback messages only. Does not suppress log output when logging is configured to print to the console. The default value is <code>false</code>.</td></tr></tbody></table>

### Build Scanner - Pull Request Session (`prConfig`) <a href="#pull-request-session-id" id="pull-request-session-id"></a>

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

```bash
##Minimum required CLI parameters
java -jar sl-build-scanner.jar prConfig \
  --token <token> \
  --appName <app-name> \
  --pullRequestNumber <pr> \
  --targetBranch <branch> \
  --latestCommit <commit> \
  --repositoryUrl <url> \
  --includePackages <include> \
  --excludePackages <exclude>
```

#### All CLI Parameters <a href="#pull-request-session-id" id="pull-request-session-id"></a>

<table><thead><tr><th width="178.94921875">CLI Parameter</th><th width="249.08203125">Legacy Alias</th><th>Description</th></tr></thead><tbody><tr><td><code>--token</code></td><td><code>--token</code></td><td>Access token generated from the SeaLights server.</td></tr><tr><td><code>--tokenFile</code></td><td><code>--tokenfile</code></td><td>Path to file containing access token generated from the SeaLights server.</td></tr><tr><td><code>--appName</code></td><td><code>--appname</code></td><td>Name of the application.</td></tr><tr><td><code>--branchName</code></td><td><code>--branch</code></td><td>The source branch of the application.</td></tr><tr><td><code>--buildName</code></td><td><code>--build</code></td><td>The build label of the current build.</td></tr><tr><td><code>--includePackages</code></td><td><code>--packagesincluded</code></td><td>Comma-separated list of packages to include in scan. Supports wildcards (<code>*</code> - any string, <code>?</code> - any character). For example, <code>'com.example.* ,io.*.demo, com.?ello.world'</code>.</td></tr><tr><td><code>--excludePackages</code></td><td><code>--packagesexcluded</code></td><td>Comma-separated list of packages to exclude from scan. Supports wildcards (<code>*</code> - any string, <code>?</code> - any character). For example, <code>'com.example.* ,io.*.demo, com.?ello.world'</code>.</td></tr><tr><td><code>--buildSessionId</code></td><td><code>--buildsessionid</code></td><td>Optional: A user provided session ID (The ID must be under 40 characters length).</td></tr><tr><td><code>--buildSessionIdFile</code></td><td><code>--buildsessionidfile</code></td><td>Path to a file to save the build session id in (Default: <code>buildSessionId.txt</code>).</td></tr><tr><td><code>--failOnError</code></td><td><code>--enableNoneZeroErrorCode</code></td><td>Indicates that the Build Scanner should return with error code in case of scan failure. On: return 1, Off: return 0.</td></tr><tr><td><code>--pullRequestNumber</code></td><td><code>--pullRequestNumber</code></td><td>The number assigned to the Pull Request from the source control.</td></tr><tr><td><code>--targetBranch</code></td><td><code>--targetBranch</code></td><td>The branch to which this Pull Request will be merged into (already reported to SeaLights).</td></tr><tr><td><code>--latestCommit</code></td><td><code>--latestCommit</code></td><td>The full SHA of the last commit made to the Pull Request.</td></tr><tr><td><code>--repositoryUrl</code></td><td><code>--repoUrl</code></td><td>The Pull Request URL for the PR to be scanned, up until the section before the <code>pullRequestNumber</code> value.</td></tr><tr><td><code>--proxy</code></td><td><code>--proxy</code></td><td>Address of proxy to run connection through.</td></tr><tr><td><code>--help</code></td><td><code>--help</code></td><td>Show Help message and exit.</td></tr><tr><td><code>--quiet</code></td><td><code>--quiet</code></td><td>Suppresses console feedback messages only. Does not suppress log output when logging is configured to print to the console. The default value is <code>false</code>.</td></tr></tbody></table>

### Build Scanner - Scanning a Build (`scan`) <a href="#pull-request-session-id" id="pull-request-session-id"></a>

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

```bash
##Minimum required CLI parameters
java -jar sl-build-scanner.jar scan \
  --token <token> \
  --buildSessionId <id>
```

#### All CLI Parameters <a href="#pull-request-session-id" id="pull-request-session-id"></a>

<table><thead><tr><th width="183.203125">CLI Parameter</th><th width="249.08203125">Legacy Alias</th><th>Description</th></tr></thead><tbody><tr><td><code>--token</code></td><td><code>--token</code></td><td>Access token generated from the SeaLights server.</td></tr><tr><td><code>--tokenFile</code></td><td><code>--tokenfile</code></td><td>Path to file containing access token generated from the SeaLights server.</td></tr><tr><td><code>--buildSessionId</code></td><td><code>--buildsessionid</code></td><td>Build Session ID (case-sensitive).</td></tr><tr><td><code>--buildSessionIdFile</code></td><td><code>--buildsessionidfile</code></td><td>Path to a <code>buildSessionId.txt</code> file.</td></tr><tr><td><code>--appName</code></td><td><code>--appname</code></td><td>Name of the application.</td></tr><tr><td><code>--branchName</code></td><td><code>--branch</code></td><td>The source branch of the application.</td></tr><tr><td><code>--buildName</code></td><td><code>--build</code></td><td>The build label of the current build.</td></tr><tr><td><code>--includePackages</code></td><td><code>--packagesincluded</code></td><td>Comma-separated list of packages to include in scan. Supports wildcards (<code>*</code> - any string, <code>?</code> - any character). For example, <code>'com.example.* ,io.*.demo, com.?ello.world'</code>.</td></tr><tr><td><code>--includeFiles</code></td><td><code>--filesIncluded</code></td><td><p>Comma-separated list of files to include in scan. Supports wildcards (<code>*</code> - any string, <code>?</code> - any character). For example: <code>'*-with-dependencies.jar</code>,</p><p>use comma separated file names or paths like <code>'SpecificFileName1.class,specificFileName2.class'</code> OR <code>'some/sub/folder/*Test.class,another/folder/*/resources/*'</code>.</p><p><strong>Don’t use</strong> dot separated packages such as <code>*.ms.*.gateways.mappers.implementation.MapResource.class</code>.</p></td></tr><tr><td><code>--excludePackages</code></td><td><code>--packagesexcluded</code></td><td>Comma-separated list of packages to exclude from scan. Supports wildcards (<code>*</code> - any string, <code>?</code> - any character). For example, <code>'com.example.* ,io.*.demo, com.?ello.world'</code>.</td></tr><tr><td><code>--excludeFiles</code></td><td><code>--filesExcluded</code></td><td><p>Comma-separated list of files to exclude from scan. Supports wildcards (<code>*</code> - any string, <code>?</code> - any character). For example: <code>'*-with-dependencies.jar</code>,</p><p>use comma separated file names or paths like <code>'SpecificFileName1.class,specificFileName2.class'</code> OR <code>'some/sub/folder/*Test.class,another/folder/*/resources/*'</code>.</p><p><strong>Don’t use</strong> dot separated packages such as <code>*.ms.*.gateways.mappers.implementation.MapResource.class</code>.</p></td></tr><tr><td><code>--scanDir</code></td><td><code>--workspacePath</code></td><td>Path to the workspace where the source code exists.</td></tr><tr><td><code>--componentFile</code></td><td><code>--dependenciesFile</code></td><td>A path to a json file with components data in the following format:                                   <code>[{"appName":"","branchName":"","buildName":""},{...}]</code> or<br><code>[{"buildSessionId":"", {...}]</code>.</td></tr><tr><td><code>--customFilterFile</code></td><td><code>--customFilterFile</code></td><td>A path to custom exclusions filter file in json format.</td></tr><tr><td><code>--moduleName</code></td><td><code>--moduleName</code></td><td>Module name used in the <code>pom.xml</code> file. Example, <code>my-app</code>.</td></tr><tr><td><code>--failOnError</code></td><td><code>--enableNoneZeroErrorCode</code></td><td>Indicates that the Build Scanner should return with error code in case of scan failure. On: return 1, Off: return 0.</td></tr><tr><td><code>--noPropertiesFile</code></td><td><code>--noPropertiesFile</code></td><td>Do not generate <code>Sealights. properties</code> file.</td></tr><tr><td><code>--propertiesFileName</code></td><td><code>--propertiesFileName</code></td><td>Path in which to create the Sealights properties file (Default: <code>sealights.properties</code>).</td></tr><tr><td><code>--pathToMetaJson</code></td><td><code>--pathToMetaJson</code></td><td>Optional: Path to a json file with metadata about the build.</td></tr><tr><td><code>--repositoryUrl</code></td><td><code>--scmUrl</code></td><td>The URL to the repository which contains the code. If left blank, the url of the remote GIT origin is being used.</td></tr><tr><td><code>--scmProvider</code></td><td><code>--scmProvider</code></td><td>The provider name of your Source Control Management (SCM). Supported values: <code>Github</code>, <code>Bitbucket</code>, <code>Gitlab</code> (Default: <code>Gitlab</code>). </td></tr><tr><td><code>--scmType</code></td><td><code>--scm</code></td><td>The name of your Source Control Management (SCM) tool. Supported values: <code>git</code>, <code>none</code> (Default: <code>git</code>). </td></tr><tr><td><code>--scmVersion</code></td><td><code>--scmVersion</code></td><td>The version of your Source Control Management (SCM) tool. If left blank, cloud version is assumed. Otherwise, specify the version of your on-premise server.</td></tr><tr><td><code>--sourceDirectory</code></td><td><code>--sourceDirectory</code></td><td>Custom source directory in Maven or Gradle project (case-sensitive).</td></tr><tr><td><code>--sourcePath</code></td><td><code>--sourcePath</code></td><td>Path to the directory where the source classes exists. Default value is the <code>--scanDir</code> path.</td></tr><tr><td><code>--proxy</code></td><td><code>--proxy</code></td><td>Address of proxy to run connection through.</td></tr><tr><td><code>--help</code></td><td><code>--help</code></td><td>Show Help message and exit.</td></tr><tr><td><code>--quiet</code></td><td><code>--quiet</code></td><td>Suppresses console feedback messages only. Does not suppress log output when logging is configured to print to the console. The default value is <code>false</code>.</td></tr></tbody></table>

### Build Scanner - Build Scan End (`buildend`) <a href="#pull-request-session-id" id="pull-request-session-id"></a>

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

```bash
##Minimum required CLI parameters
java -jar sl-build-scanner.jar buildend \
  --token <token> \
  --buildSessionId <id>
```

#### All CLI Parameters <a href="#pull-request-session-id" id="pull-request-session-id"></a>

<table><thead><tr><th width="178.94921875">CLI Parameter</th><th width="249.08203125">Legacy Alias</th><th>Description</th></tr></thead><tbody><tr><td><code>--token</code></td><td><code>--token</code></td><td>Access token generated from the SeaLights server.</td></tr><tr><td><code>--tokenFile</code></td><td><code>--tokenfile</code></td><td>Path to file containing access token generated from the SeaLights server.</td></tr><tr><td><code>--buildSessionId</code></td><td><code>--buildsessionid</code></td><td>Build Session ID (case-sensitive).</td></tr><tr><td><code>--buildSessionIdFile</code></td><td><code>--buildsessionidfile</code></td><td>Path to a <code>buildSessionId.txt</code> file.</td></tr><tr><td><code>--failed</code></td><td><code>--failed</code></td><td>Indicates build failure.</td></tr><tr><td><code>--ok</code></td><td><code>--ok</code></td><td>Indicates build success.</td></tr><tr><td><code>--proxy</code></td><td><code>--proxy</code></td><td>Address of proxy to run connection through.</td></tr><tr><td><code>--help</code></td><td><code>--help</code></td><td>Show Help message and exit.</td></tr><tr><td><code>--quiet</code></td><td><code>--quiet</code></td><td>Suppresses console feedback messages only. Does not suppress log output when logging is configured to print to the console. The default value is <code>false</code>.</td></tr></tbody></table>

### Build Scanner - Updating/Deleting a component from an integration build (`componentUpdate`) <a href="#standard-session-id" id="standard-session-id"></a>

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

{% tabs %}
{% tab title="Update" %}

```bash
##Minimum required CLI parameters
java -jar sl-build-scanner.jar componentUpdate \
  --token <token> \
  --buildSessionId <id> \
  --componentFile
```

{% endtab %}

{% tab title="Delete" %}

```bash
java -jar sl-build-scanner.jar componentDelete \
  --token <token> \
  --buildSessionId <id> \
  --componentIds
```

{% endtab %}
{% endtabs %}

#### All CLI Parameters <a href="#pull-request-session-id" id="pull-request-session-id"></a>

<table><thead><tr><th width="178.94921875">CLI Parameter</th><th width="249.08203125">Legacy Alias</th><th>Description</th></tr></thead><tbody><tr><td><code>--token</code></td><td><code>--token</code></td><td>Access token generated from the SeaLights server.</td></tr><tr><td><code>--tokenFile</code></td><td><code>--tokenfile</code></td><td>Path to file containing access token generated from the SeaLights server.</td></tr><tr><td><code>--buildSessionId</code></td><td><code>--buildsessionid</code></td><td>Build Session ID (case-sensitive).</td></tr><tr><td><code>--buildSessionIdFile</code></td><td><code>--buildsessionidfile</code></td><td>Path to a <code>buildSessionId.txt</code> file.</td></tr><tr><td><code>--componentFile</code></td><td><code>--dependenciesFile</code></td><td>A path to a json file with components data in the following format:                                   <code>[{"appName":"","branchName":"","buildName":""},{...}]</code> or<br><code>[{"buildSessionId":"", {...}]</code>.</td></tr><tr><td><code>--componentIds</code></td><td><code>--componentIds</code></td><td>One or more build session ID's (comma separated) of the components to be updated or deleted.</td></tr><tr><td><code>--proxy</code></td><td><code>--proxy</code></td><td>Address of proxy to run connection through.</td></tr><tr><td><code>--help</code></td><td><code>--help</code></td><td>Show Help message and exit.</td></tr><tr><td><code>--quiet</code></td><td><code>--quiet</code></td><td>Suppresses console feedback messages only. Does not suppress log output when logging is configured to print to the console. The default value is <code>false</code>.</td></tr></tbody></table>

## Test Listener <a href="#test-listener" id="test-listener"></a>

{% hint style="warning" %}
The `--buildSessionId` and `--buildSessionIdFile` CLI parameters are **deprecated** for test-runner commands. Use `--labId` instead. These parameters remain supported only for unit-test runners that execute the build's code directly.
{% endhint %}

### Test Listener - Opening a Test Stage (`start`) <a href="#starting-a-test-stage" id="starting-a-test-stage"></a>

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

```bash
##Minimum required CLI parameters
java -jar sl-test-listener.jar start \
  --token <token> \
  --labId <labid> \
  --testStage <teststage>
```

#### **All CLI Parameters**

<table><thead><tr><th width="178.94921875">CLI Parameter</th><th width="249.08203125">Legacy Alias</th><th>Description</th></tr></thead><tbody><tr><td><code>--token</code></td><td><code>--token</code></td><td>Access token generated from the SeaLights server.</td></tr><tr><td><code>--tokenFile</code></td><td><code>--tokenfile</code></td><td>Path to file containing access token generated from the SeaLights server.</td></tr><tr><td><code>--appName</code></td><td><code>--appname</code></td><td>Name of the application.</td></tr><tr><td><code>--branchName</code></td><td><code>--branch</code></td><td>The source branch of the application.</td></tr><tr><td><code>--buildName</code></td><td><code>--build</code></td><td>Build label of the current build.</td></tr><tr><td><code>--testStage</code></td><td><code>--testStage</code></td><td>Name of the test stage. Example, <code>Integration Tests</code>, <code>Regression Tests</code>, etc.</td></tr><tr><td><code>--labId</code></td><td><code>--labid</code></td><td>Unique ID for a set of test labs in case multiple labs are running simultaneously (case-sensitive).</td></tr><tr><td><code>--proxy</code></td><td><code>--proxy</code></td><td>Address of proxy to run connection through.</td></tr><tr><td><code>--help</code></td><td><code>--help</code></td><td>Show Help message and exit.</td></tr><tr><td><code>--quiet</code></td><td><code>--quiet</code></td><td>Suppresses console feedback messages only. Does not suppress log output when logging is configured to print to the console. The default value is <code>false</code>.</td></tr></tbody></table>

{% hint style="info" %}
`sl.calibrationLearning`  enables calibration learning mode for Test Optimization (TIA).

This property can be set as a Java system property:

```bash
java -Dsl.calibrationLearning=true -jar sl-test-listener.jar start ...
```

Or as an environment variable:

```
SL_CALIBRATION_LEARNING=true
```

When set to `true`, the test run is marked as a **calibration execution** for Test Optimization.

**Available since:** SeaLights Java Agent v4.0.2610.
{% endhint %}

### Test Listener - Uploading Report Files (`uploadReports`) <a href="#upload-report-files" id="upload-report-files"></a>

{% hint style="warning" %}
Report files must be JUnit style XML reports.
{% endhint %}

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

```bash
##Minimum required CLI parameters
java -jar sl-test-listener.jar uploadReports \
  --token <token> \
  --labId <labid> \
  --testStage <teststage>
```

#### **All CLI Parameters** <a href="#inlineextension-upload-report-files" id="inlineextension-upload-report-files"></a>

<table><thead><tr><th width="178.94921875">CLI Parameter</th><th width="249.08203125">Legacy Alias</th><th>Description</th></tr></thead><tbody><tr><td><code>--token</code></td><td><code>--token</code></td><td>Access token generated from the SeaLights server.</td></tr><tr><td><code>--tokenFile</code></td><td><code>--tokenfile</code></td><td>Path to file containing access token generated from the SeaLights server.</td></tr><tr><td><code>--appName</code></td><td><code>--appname</code></td><td>Name of the application.</td></tr><tr><td><code>--branchName</code></td><td><code>--branch</code></td><td>The source branch of the application.</td></tr><tr><td><code>--buildName</code></td><td><code>--build</code></td><td>Build label of the current build.</td></tr><tr><td><code>--labId</code></td><td><code>--labid</code></td><td>Unique ID for a set of test labs in case multiple labs are running simultaneously (case-sensitive).</td></tr><tr><td><code>--hasMoreRequests</code></td><td><code>--hasMoreRequests</code></td><td>Set as <code>false</code> in order to force this run to end the test execution after the upload (Default: <code>true</code>).</td></tr><tr><td><code>--reportFile</code></td><td><code>--reportFile</code></td><td>Report files. This argument can be declared multiple times in order to upload multiple files.</td></tr><tr><td><code>--reportFilesFolder</code></td><td><code>--reportFilesFolder</code></td><td>Folder that contains the report files. All files in this folder will be uploaded. This argument can be declared multiple times in order to upload multiple files from multiple folders.</td></tr><tr><td><code>--source</code></td><td><code>--source</code></td><td>The reports provider (Default: <code>Junit xml report</code>).</td></tr><tr><td><code>--type</code></td><td><code>--type</code></td><td><p>The report type. </p><p>Values:</p><ul><li><code>JUnitReport</code> - For uploading JUnit test report files</li><li><code>commitLog</code> - For uploading git style commit logs</li></ul><p>(Default: <code>JunitReport</code>).</p></td></tr><tr><td><code>--proxy</code></td><td><code>--proxy</code></td><td>Address of proxy to run connection through.</td></tr><tr><td><code>--help</code></td><td><code>--help</code></td><td>Show Help message and exit.</td></tr><tr><td><code>--quiet</code></td><td><code>--quiet</code></td><td>Suppresses console feedback messages only. Does not suppress log output when logging is configured to print to the console. The default value is <code>false</code>.</td></tr></tbody></table>

### Test Listener - Closing a Test Stage (`end`) <a href="#ending-a-test-stage" id="ending-a-test-stage"></a>

This example is with minimum required CLI Parameters. All available CLI Parameters can be found in the table below.

```bash
##Minimum required CLI parameters
java -jar sl-test-listener.jar end \
  --token <token> \
  --labId <labid>
```

#### **All CLI Parameters**

<table><thead><tr><th width="178.94921875">CLI Parameter</th><th width="249.08203125">Legacy Alias</th><th>Description</th></tr></thead><tbody><tr><td><code>--token</code></td><td><code>--token</code></td><td>Access token generated from the SeaLights server.</td></tr><tr><td><code>--tokenFile</code></td><td><code>--tokenfile</code></td><td>Path to file containing access token generated from the SeaLights server.</td></tr><tr><td><code>--appName</code></td><td><code>--appname</code></td><td>Name of the application.</td></tr><tr><td><code>--branchName</code></td><td><code>--branch</code></td><td>The source branch of the application.</td></tr><tr><td><code>--buildName</code></td><td><code>--build</code></td><td>Build label of the current build.</td></tr><tr><td><code>--labId</code></td><td><code>--labid</code></td><td>Unique ID for a set of test labs in case multiple labs are running simultaneously (case-sensitive).</td></tr><tr><td><code>--proxy</code></td><td><code>--proxy</code></td><td>Address of proxy to run connection through.</td></tr><tr><td><code>--help</code></td><td><code>--help</code></td><td>Show Help message and exit.</td></tr><tr><td><code>--quiet</code></td><td><code>--quiet</code></td><td>Suppresses console feedback messages only. Does not suppress log output when logging is configured to print to the console. The default value is <code>false</code>.</td></tr></tbody></table>

### Installing test listener as Java Agent <a href="#installing-test-listener-as-java-agent" id="installing-test-listener-as-java-agent"></a>

The listener needs to be placed alongside the server and added to the JVM command line using the `-javaagent` parameter together with its required parameters.

Usually, the easiest is to place it in the `JAVA_OPTS="..."`, although it can also be placed in the JVM command itself.

{% code overflow="wrap" lineNumbers="true" %}

```sh
java -javaagent:/path/to/sl-test-listener.jar {-Dsl.token=<arg> | -Dsl.tokenFile=<arg>} {-Dsl.buildSessionId=<arg> | -Dsl.buildSessionIdFile=<arg>} [-Dsl.tags=<arg>] [-Dsl.labId=<arg>] [-Dsl.proxy=<arg>] [-Dsl.testStage=<arg>] [-Dsl.filesStorage=<folder>] [-Dsl.webappLocation=<arg>] -jar yourapp.jar
```

{% endcode %}

<table><thead><tr><th width="277.71484375">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>javaagent</code></td><td>Path to Sealights Java test agent jar.</td></tr><tr><td><code>sl.token</code></td><td>Access token generated from the SeaLights server.</td></tr><tr><td><code>sl.tokenFile</code></td><td>Path to file containing the access token generated from the SeaLights server.</td></tr><tr><td><code>sl.buildSessionId</code></td><td>Session ID of configuration created.</td></tr><tr><td><code>sl.buildSessionIdFile</code></td><td>Path to file containing the Session ID of configuration created.</td></tr><tr><td><code>sl.tags</code></td><td>One or several tags (comma separated) to be passed to Sealights in order to label the test listener in the cockpit.</td></tr><tr><td><code>sl.labId</code></td><td>Unique ID for a set of test labs in case multiple labs are running simultaneously.</td></tr><tr><td><code>sl.proxy</code></td><td>Address of proxy to run connection through.</td></tr><tr><td><code>sl.testStage</code></td><td>Name of the test stage (When running with JMeter).</td></tr><tr><td><code>sl.filesStorage</code></td><td>Path to a folder that the agent can save temporary files to.</td></tr><tr><td><code>sl.webappLocation</code></td><td>Optional: Path to the folder containing the artifact of the application (Default: <code>webapps</code>).<br>If the property is provided, the agent looks recursively inside the <code>.war</code> and <code>.ear</code> files in the path defined by the property. The search stops on the first file found.<br>This parameter is used when the agent does not find automatically the <code>sltoken.txt</code> and <code>buildSessionId.txt</code> files added to the artifact by Sealights Maven or Gradle plugins during the build.</td></tr><tr><td><code>sl.collectorUrl</code></td><td>HTTP/HTTPS DNS to the collector for when working with lambda methods.</td></tr></tbody></table>

## **Logging** <a href="#logging" id="logging"></a>

In order to enable logs, you can set the following parameters as environment variables or, when using as `javaagent`, add them as `-Dsl.*` parameters.\
Both console output and file options are compatible and non-exclusive.

For logging into the console, add:

{% code overflow="wrap" lineNumbers="true" %}

```sh
-Dsl.log.toConsole=true -Dsl.log.level=info [--add-opens=java.base/jdk.internal.loader=ALL-UNNAMED]
```

{% endcode %}

For logging into a file, add:

{% code overflow="wrap" lineNumbers="true" %}

```sh
-Dsl.log.toFile=true -Dsl.log.level=info -Dsl.log.folder=<path/with/permissions/> [--add-opens=java.base/jdk.internal.loader=ALL-UNNAMED] [-Dsl.log.count=<value>] [-Dsl.log.limit=<arg>] [-Dsl.log.filename=<arg>]
```

{% endcode %}

<table><thead><tr><th width="291.0234375">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>sl.log.level</code></td><td>Sets the log level to one of the following: <code>off</code>, <code>error</code>, <code>warn</code>, <code>info</code>, <code>debug</code>.</td></tr><tr><td><code>sl.log.toConsole</code></td><td>Set to <code>true</code> to enable log output to the console.</td></tr><tr><td><code>sl.log.toFile</code></td><td>Set to <code>true</code> to enable log output to a file.</td></tr><tr><td><code>sl.log.folder</code></td><td>Provide a folder to save the log files in.</td></tr><tr><td><code>sl.log.filename</code></td><td>Provide the name of the log file.</td></tr><tr><td><code>sl.log.count</code></td><td>Limit the number of log files to create (Default: <code>10</code>).</td></tr><tr><td><code>sl.log.limit</code></td><td>Limit the size of the log file in megabytes (MB) (Default: <code>10</code> (i.e. 10*1024 KB)).</td></tr><tr><td><code>--add-opens=java.base/jdk.internal.loader=ALL-UNNAMED</code></td><td>Special JVM parameter to allow logging in Java 9 and later in addition to <code>-Dsl.log.*</code> options above.<br>If the option is not provided, the test listener will work as usual, but logging will not work.</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/java-agent/command-reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
