RFR: 8327410: Add hostname option for UL file names [v3]

David Holmes dholmes at openjdk.org
Mon Mar 11 03:32:01 UTC 2024


On Fri, 8 Mar 2024 15:26:21 GMT, Fredrik Bredberg <fbredberg at openjdk.org> wrote:

>> Added %hn as way to make the Unified Logging file name include the host name.
>> This is done in line with the already existing %p for pid, and %t for time stamp.
>> 
>> Also the %hn decorator is already used to prepend the host name to each log line. See: The [JDK-8148219](https://bugs.openjdk.org/browse/JDK-8148219).
>> 
>> Example: `java -Xlog:gc+init:file=frbr_%hn.%p.%t.log -version`
>> 
>> Tested tier1-tier5.
>
> Fredrik Bredberg has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update after review

src/hotspot/share/logging/logConfiguration.cpp line 617:

> 615:   out->print_cr(" stdout/stderr");
> 616:   out->print_cr(" file=<filename>");
> 617:   out->print_cr("  If the filename contains %%p, %%t and/or %%hn, they will expand to the JVM's PID, startup timestamp and host name, respectively.");

The same update needs to be applied to the java manpage please - closed source (java.md) and open troff (java.1) files.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/18153#discussion_r1519083107


More information about the hotspot-runtime-dev mailing list