Master switch for Log Store on the JVM side. Requires OptHubHost. Note that -XX:+UnlockExperimentalVMOptions is not required; EnableLogStore is a product flag.
On its own this flag uploads nothing — at least one -Xlog file output with store=remote-only or store=local-remote is needed to send log data.
Using Log Store
Optimizer Hub Log Store requires settings on the client side to send the logs, and use of the API to retrieve them.
Configuring the Client
You configure Azul Zing Builds of OpenJDK (Zing) to send its logs to the Optimizer Hub Log Store by specifying the address of the service along with other command-line options.
|
Note
|
By default, all log outputs remain local. Log Store only receives outputs you explicitly opt in by adding a store= option to individual -Xlog file outputs.
|
|
Note
|
The logs and crash reports that Log Store collects can contain sensitive data from your application. Before you share these files with Azul or another partner for further investigation, sanitize them. See About Log Store > Sensitive Data in Logs. |
Log Store JVM Options
The minimum JVM options to enable Log Store are -XX:+EnableLogStore, -XX:OptHubHost=<host>:<port>, and -XX:ProfileName=<name>. These options make Log Store available but do not send any log data until you configure individual -Xlog file outputs with the store= option (see Log Store Option for -Xlog Outputs).
| Command Line Option | Description | Default |
|---|---|---|
-XX:+EnableLogStore |
false |
|
-XX:OptHubHost=<host>:<port> |
|
null |
-XX:ProfileName=<name> |
Required whenever |
null |
-XX:-OptHubUseSSL |
Set this flag to use a plaintext connection to the gateway. TLS is on by default. |
true (TLS on) |
-XX:LogStoreUpload=hs_err |
Opt in to also uploading crash reports to Log Store. The crash report ( |
(empty) |
Log Store Option for -Xlog Outputs
To send log data to Log Store, add a store= option to individual -Xlog file outputs. The option controls where each output goes:
| Value | Behavior |
|---|---|
|
Output is written to the local file only. This is the default. |
|
Output is sent to Log Store only; no local file is written. |
|
Output is written to the local file and also sent to Log Store. Recommended when local disk is available, since it protects against connectivity issues. |
Example:
# GC log both locally and in Log Store, local file rotated
-Xlog:gc*:file=gc-%p.log:time,uptime,level,tags:store=local-remote,filecount=5,filesize=50M
# Safepoint log in Log Store only, no local file
-Xlog:safepoint*:file=safepoint-%p.log::store=remote-only
|
Note
|
The store= option applies only to file= outputs. Outputs to stdout or stderr and -Xloggc are always local and cannot be sent to Log Store. The store= option cannot be changed at runtime with jcmd VM.log.
|
Log Store Filename
The filename you provide in the -Xlog command line option determines how the log is stored in blob storage. Use descriptive naming to make it easy to identify logs when downloading them later.
Log Store treats unified logging tags exactly the way local unified logging does. For example, if you define several tags with the same file name, the JVM merges the data from both lines into a single file.
hs_err files are saved as hs_err_pid<pid>.log, or with the filename specified with the -XX:ErrorFile=<value> command-line option.
When you download log files through the API, the VMID is added to the filename to make it clear which file was provided by which machine. For example, inside a ZIP file downloaded from the API you can find a file xlog/I_8koS0TRCCQFtYSh6hgig_unified_gc_53.log, which is unified_gc_53.log from the machine with VMID I_8koS0TRCCQFtYSh6hgig.
Retrieving Logs from Optimizer Hub
Logs are retrieved through the Optimizer Hub management gateway REST API. The management gateway runs on port 8080 by default.
| Call | Purpose |
|---|---|
|
List VM instances and their VM IDs. |
|
Download all logs for a VM as a ZIP file. |
|
List all logs available for a VM. |
|
Download the content of a single log. |
Step-by-step to retrieve the logs for a specific JVM:
-
Get the VM ID of the JVM either from:
-
stdoutof the application. -
The API
GET /api/vmInstanceswith the hostname of the VM as a query parameter. Since hostnames can be reused when the container restarts, there may be multiple VM IDs per hostname. In this case, use thelastActivefield to identify the VMID for the right pod.
-
-
Call
GET /api/vmInstances/<VMID>/logsfor a list of all logs available for this JVM. -
Call
POST /api/vmInstances/<VMID>/logs:exportto export all logs as a ZIP file.
If Optimizer Hub detected missing log chunks, the ZIP also contains a <VMID>_LOG_GAPS.txt file listing them.
Check the API documentation for more info.