# gcCaptureMode
Allows users to specify a custom command to be executed for capturing or locating the Garbage Collection (GC) log, enabling users to dynamically determine or generate GC log paths during the capture process.
The command should output a valid file path, which will be used for GC log capture.
Type: string
Default: ""
How it works internally:
- Executed only when
gcPathis not explicitly provided. - The yc-360 script runs the command via
/bin/sh -c, injectingpidas an environment variable. - The script's output (stdout) must return a valid GC log file path.
- The returned path is used for GC log collection.
Example (YAML):
Run jcmd to generate GC data and echo the file path:
options:
gcCaptureMode: "jcmd $pid GC.class_histogram > /tmp/gc_$pid.log && echo /tmp/gc_$pid.log"
1
2
2
Run inside a Docker container and locate a GC log:
options:
gcCaptureMode: docker exec $(docker ps -q --filter label=app.pid=$pid) find /logs -name gc.log"
1
2
2
Example (CLI):
Run jcmd to generate GC data and echo the file path:
/yc -gcCaptureMode "jcmd $pid GC.class_histogram > /tmp/gc_$pid.log && echo /tmp/gc_$pid.log"
1
Run inside a Docker container and locate a GC log:
./yc -gcCaptureMode "docker exec $(docker ps -q --filter label=app.pid=$pid) find /logs -name gc.log"
1
← gcCaptureCmd gcPath →